[PULL] soc-camera: welcome a new host: OMAP1 and a couple of new sensor drivers

2010-10-08 Thread Guennadi Liakhovetski
Hi Mauro

So, as promised, here goes part 2 of 2.6.37 patches for soc-camera and 
related. There's also going to be one issue with this one to take care of: 
the last patch will conflict with Laurent's pad-level ops patches, which 
also move mediabus pixel codes around. But since Laurent's patches are 
still at the RFC stage, AFAICS, they'll have to be extended slightly:)

The following changes since commit 81d64d12e11a3cca995e6c752e4bd2898959ed0a:

  V4L/DVB: cx231xx: remove some unused functions (2010-10-07 21:05:52 -0300)

are available in the git repository at:
  git://linuxtv.org/gliakhovetski/v4l-dvb.git for-2.6.37

Guennadi Liakhovetski (3):
  V4L: add IMX074 sensor chip ID
  V4L: add an IMX074 sensor soc-camera / v4l2-subdev driver
  V4L: sh_mobile_ceu_camera: use default .get_parm() and .set_parm() 
operations

Janusz Krzysztofik (3):
  SoC Camera: add driver for OMAP1 camera interface
  SoC Camera: add driver for OV6650 sensor
  SoC Camera: add support for g_parm / s_parm operations

Michael Grzeschik (1):
  mt9m111: changed MIN_DARK_COLS to MT9M131 spec count

Sascha Hauer (1):
  v4l2-mediabus: Add pixelcodes for BGR565 formats

 drivers/media/video/Kconfig|   20 +
 drivers/media/video/Makefile   |3 +
 drivers/media/video/imx074.c   |  508 +
 drivers/media/video/mt9m111.c  |2 +-
 drivers/media/video/omap1_camera.c | 1702 
 drivers/media/video/ov6650.c   | 1225 
 drivers/media/video/sh_mobile_ceu_camera.c |   18 -
 drivers/media/video/soc_camera.c   |   18 +
 include/media/omap1_camera.h   |   35 +
 include/media/v4l2-chip-ident.h|4 +
 include/media/v4l2-mediabus.h  |2 +
 11 files changed, 3518 insertions(+), 19 deletions(-)
 create mode 100644 drivers/media/video/imx074.c
 create mode 100644 drivers/media/video/omap1_camera.c
 create mode 100644 drivers/media/video/ov6650.c
 create mode 100644 include/media/omap1_camera.h

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] soc-camera: welcome a new host: OMAP1 and a couple of new sensor drivers

2010-10-08 Thread Laurent Pinchart
Hi Guennadi,

On Friday 08 October 2010 09:00:36 Guennadi Liakhovetski wrote:
 Hi Mauro
 
 So, as promised, here goes part 2 of 2.6.37 patches for soc-camera and
 related. There's also going to be one issue with this one to take care of:
 the last patch will conflict with Laurent's pad-level ops patches, which
 also move mediabus pixel codes around. But since Laurent's patches are
 still at the RFC stage, AFAICS, they'll have to be extended slightly:)

That's fine with me.

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/4] Add support for camera capture in s5p-fimc driver

2010-10-08 Thread Sylwester Nawrocki
Hi all,

here is a fourth version of patches adding camera capture capability
to the s5p-fimc driver. It contains minor changes to adhere to patch
submitting rules. 

Changes since v1:
- entirely removed plat-samsung/include/plat/fimc.h header so there is no
  platform code dependency
- improved s/try_fmt ioctl and introduced common ioctl handlers for mem2mem 
  and capture node where it's reasonable
- register definition changes merged with previous commit   
  [3/8] v4l: s5p-fimc: Register definition cleanup

Changes since v2:
- improved s/g/crop(cap) handling in capture node
- added passing of v4l controls to the sensor subdevice

Changes since v3:
- changed summary of patch [4/4] to adhere to patch submitting guidelines
- patch V4L/DVB: s5p-fimc: M2M driver cleanup.. split to 2 separate
  commits - 2/5 and 3/5 in this series

The patch series contains:

[PATCH 1/5] V4L/DVB: s5p-fimc: Register definition cleanup
[PATCH 2/5] V4L/DVB: s5p-fimc: mem2mem driver refactoring and cleanup
[PATCH 3/5] V4L/DVB: s5p-fimc: Fix 90/270 deg rotation errors
[PATCH 4/5] V4L/DVB: s5p-fimc: Do not lock both capture and output buffer queue 
in s_fmt
[PATCH 5/5] V4L/DVB: s5p-fimc: Add camera capture support

It has been rebased onto linuxtv/staging-2.6.37 branch at
git://linuxtv.org/media_tree.git with 2 bugfix patches:

v4l: s5p-fimc: Fix 3-planar formats handling and pixel offset error on S5PV210 
SoCs
v4l: s5p-fimc: Fix return value on probe() failure

also applied.

Regards,
Sylwester

--
Sylwester Nawrocki
Linux Platform Group
Samsung Poland RD Center
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/5 v4] V4L/DVB: s5p-fimc: Register definition cleanup

2010-10-08 Thread Sylwester Nawrocki
Add MIPI CSI format definitions, prepare DMA address
definitions for interlaced input frame mode.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/video/s5p-fimc/fimc-reg.c  |6 +-
 drivers/media/video/s5p-fimc/regs-fimc.h |   61 -
 2 files changed, 28 insertions(+), 39 deletions(-)

diff --git a/drivers/media/video/s5p-fimc/fimc-reg.c 
b/drivers/media/video/s5p-fimc/fimc-reg.c
index 5570f1c..70f29c5 100644
--- a/drivers/media/video/s5p-fimc/fimc-reg.c
+++ b/drivers/media/video/s5p-fimc/fimc-reg.c
@@ -507,9 +507,9 @@ void fimc_hw_set_input_addr(struct fimc_dev *dev, struct 
fimc_addr *paddr)
cfg |= S5P_CIREAL_ISIZE_ADDR_CH_DIS;
writel(cfg, dev-regs + S5P_CIREAL_ISIZE);
 
-   writel(paddr-y, dev-regs + S5P_CIIYSA0);
-   writel(paddr-cb, dev-regs + S5P_CIICBSA0);
-   writel(paddr-cr, dev-regs + S5P_CIICRSA0);
+   writel(paddr-y, dev-regs + S5P_CIIYSA(0));
+   writel(paddr-cb, dev-regs + S5P_CIICBSA(0));
+   writel(paddr-cr, dev-regs + S5P_CIICRSA(0));
 
cfg = ~S5P_CIREAL_ISIZE_ADDR_CH_DIS;
writel(cfg, dev-regs + S5P_CIREAL_ISIZE);
diff --git a/drivers/media/video/s5p-fimc/regs-fimc.h 
b/drivers/media/video/s5p-fimc/regs-fimc.h
index a3cfe82..9e83315 100644
--- a/drivers/media/video/s5p-fimc/regs-fimc.h
+++ b/drivers/media/video/s5p-fimc/regs-fimc.h
@@ -11,10 +11,6 @@
 #ifndef REGS_FIMC_H_
 #define REGS_FIMC_H_
 
-#define S5P_CIOYSA(__x)(0x18 + (__x) * 4)
-#define S5P_CIOCBSA(__x)   (0x28 + (__x) * 4)
-#define S5P_CIOCRSA(__x)   (0x38 + (__x) * 4)
-
 /* Input source format */
 #define S5P_CISRCFMT   0x00
 #define S5P_CISRCFMT_ITU601_8BIT   (1  31)
@@ -28,22 +24,21 @@
 
 /* Window offset */
 #define S5P_CIWDOFST   0x04
-#define S5P_CIWDOFST_WINOFSEN  (1  31)
+#define S5P_CIWDOFST_OFF_EN(1  31)
 #define S5P_CIWDOFST_CLROVFIY  (1  30)
 #define S5P_CIWDOFST_CLROVRLB  (1  29)
-#define S5P_CIWDOFST_WINHOROFST_MASK   (0x7ff  16)
+#define S5P_CIWDOFST_HOROFF_MASK   (0x7ff  16)
 #define S5P_CIWDOFST_CLROVFICB (1  15)
 #define S5P_CIWDOFST_CLROVFICR (1  14)
-#define S5P_CIWDOFST_WINHOROFST(x) ((x)  16)
-#define S5P_CIWDOFST_WINVEROFST(x) ((x)  0)
-#define S5P_CIWDOFST_WINVEROFST_MASK   (0xfff  0)
+#define S5P_CIWDOFST_HOROFF(x) ((x)  16)
+#define S5P_CIWDOFST_VEROFF(x) ((x)  0)
+#define S5P_CIWDOFST_VEROFF_MASK   (0xfff  0)
 
 /* Global control */
 #define S5P_CIGCTRL0x08
 #define S5P_CIGCTRL_SWRST  (1  31)
 #define S5P_CIGCTRL_CAMRST_A   (1  30)
 #define S5P_CIGCTRL_SELCAM_ITU_A   (1  29)
-#define S5P_CIGCTRL_SELCAM_ITU_MASK(1  29)
 #define S5P_CIGCTRL_TESTPAT_NORMAL (0  27)
 #define S5P_CIGCTRL_TESTPAT_COLOR_BAR  (1  27)
 #define S5P_CIGCTRL_TESTPAT_HOR_INC(2  27)
@@ -61,6 +56,8 @@
 #define S5P_CIGCTRL_SHDW_DISABLE   (1  12)
 #define S5P_CIGCTRL_SELCAM_MIPI_A  (1  7)
 #define S5P_CIGCTRL_CAMIF_SELWB(1  6)
+/* 0 - ITU601; 1 - ITU709 */
+#define S5P_CIGCTRL_CSC_ITU601_709 (1  5)
 #define S5P_CIGCTRL_INVPOLHSYNC(1  4)
 #define S5P_CIGCTRL_SELCAM_MIPI(1  3)
 #define S5P_CIGCTRL_INTERLACE  (1  0)
@@ -72,23 +69,10 @@
 #define S5P_CIWDOFST2_HOROFF(x)((x)  16)
 #define S5P_CIWDOFST2_VEROFF(x)((x)  0)
 
-/* Output DMA Y plane start address */
-#define S5P_CIOYSA10x18
-#define S5P_CIOYSA20x1c
-#define S5P_CIOYSA30x20
-#define S5P_CIOYSA40x24
-
-/* Output DMA Cb plane start address */
-#define S5P_CIOCBSA1   0x28
-#define S5P_CIOCBSA2   0x2c
-#define S5P_CIOCBSA3   0x30
-#define S5P_CIOCBSA4   0x34
-
-/* Output DMA Cr plane start address */
-#define S5P_CIOCRSA1   0x38
-#define S5P_CIOCRSA2   0x3c
-#define S5P_CIOCRSA3   0x40
-#define S5P_CIOCRSA4   0x44
+/* Output DMA Y/Cb/Cr plane start addresses */
+#define S5P_CIOYSA(n)  (0x18 + (n) * 4)
+#define S5P_CIOCBSA(n) (0x28 + (n) * 4)
+#define S5P_CIOCRSA(n) (0x38 + (n) * 4)
 
 /* Target image format */
 #define S5P_CITRGFMT   0x48
@@ -168,6 +152,8 @@
 #define S5P_CISTATUS_OVFICB(1  30)
 #define S5P_CISTATUS_OVFICR(1  29)
 #define S5P_CISTATUS_VSYNC (1  28)
+#define S5P_CISTATUS_FRAMECNT_MASK (3  26)
+#define S5P_CISTATUS_FRAMECNT_SHIFT26
 #define S5P_CISTATUS_WINOFF_EN (1  25)
 #define S5P_CISTATUS_IMGCPT_EN (1  22)
 #define S5P_CISTATUS_IMGCPT_SCEN   (1  21)
@@ -206,10 +192,10 @@
 #define S5P_CIIMGEFF_PAT_CB(x) ((x)  13)
 #define S5P_CIIMGEFF_PAT_CR(x) 

[PATCH 2/5 v4] V4L/DVB: s5p-fimc: mem2mem driver refactoring and cleanup

2010-10-08 Thread Sylwester Nawrocki
Register access functions refactored for camera capture interface
control. Removed the workqueue since it was only useful for FIFO
output mode which is not supported at this time.
Fixed errors on module unload. Comments and whitespace cleanup.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/video/s5p-fimc/fimc-core.c |  151 +++---
 drivers/media/video/s5p-fimc/fimc-core.h |  132 ++
 drivers/media/video/s5p-fimc/fimc-reg.c  |   43 -
 3 files changed, 148 insertions(+), 178 deletions(-)

diff --git a/drivers/media/video/s5p-fimc/fimc-core.c 
b/drivers/media/video/s5p-fimc/fimc-core.c
index c56029e..fccab13 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -117,7 +117,7 @@ static struct fimc_fmt fimc_formats[] = {
.buff_cnt = 1,
.planes_cnt = 2
}
- };
+};
 
 static struct v4l2_queryctrl fimc_ctrls[] = {
{
@@ -127,16 +127,14 @@ static struct v4l2_queryctrl fimc_ctrls[] = {
.minimum= 0,
.maximum= 1,
.default_value  = 0,
-   },
-   {
+   }, {
.id = V4L2_CID_VFLIP,
.type   = V4L2_CTRL_TYPE_BOOLEAN,
.name   = Vertical flip,
.minimum= 0,
.maximum= 1,
.default_value  = 0,
-   },
-   {
+   }, {
.id = V4L2_CID_ROTATE,
.type   = V4L2_CTRL_TYPE_INTEGER,
.name   = Rotation (CCW),
@@ -181,28 +179,23 @@ static int fimc_check_scaler_ratio(struct v4l2_rect *r, 
struct fimc_frame *f)
 
 static int fimc_get_scaler_factor(u32 src, u32 tar, u32 *ratio, u32 *shift)
 {
-   if (src = tar * 64) {
+   u32 sh = 6;
+
+   if (src = 64 * tar)
return -EINVAL;
-   } else if (src = tar * 32) {
-   *ratio = 32;
-   *shift = 5;
-   } else if (src = tar * 16) {
-   *ratio = 16;
-   *shift = 4;
-   } else if (src = tar * 8) {
-   *ratio = 8;
-   *shift = 3;
-   } else if (src = tar * 4) {
-   *ratio = 4;
-   *shift = 2;
-   } else if (src = tar * 2) {
-   *ratio = 2;
-   *shift = 1;
-   } else {
-   *ratio = 1;
-   *shift = 0;
+
+   while (sh--) {
+   u32 tmp = 1  sh;
+   if (src = tar * tmp) {
+   *shift = sh, *ratio = tmp;
+   return 0;
+   }
}
 
+   *shift = 0, *ratio = 1;
+
+   dbg(s: %d, t: %d, shift: %d, ratio: %d,
+   src, tar, *shift, *ratio);
return 0;
 }
 
@@ -265,8 +258,8 @@ static int fimc_set_scaler_info(struct fimc_ctx *ctx)
 static irqreturn_t fimc_isr(int irq, void *priv)
 {
struct fimc_vid_buffer *src_buf, *dst_buf;
-   struct fimc_dev *fimc = (struct fimc_dev *)priv;
struct fimc_ctx *ctx;
+   struct fimc_dev *fimc = priv;
 
BUG_ON(!fimc);
fimc_hw_clear_irq(fimc);
@@ -281,7 +274,7 @@ static irqreturn_t fimc_isr(int irq, void *priv)
dst_buf = v4l2_m2m_dst_buf_remove(ctx-m2m_ctx);
if (src_buf  dst_buf) {
spin_lock(fimc-irqlock);
-   src_buf-vb.state = dst_buf-vb.state =  VIDEOBUF_DONE;
+   src_buf-vb.state = dst_buf-vb.state = VIDEOBUF_DONE;
wake_up(src_buf-vb.done);
wake_up(dst_buf-vb.done);
spin_unlock(fimc-irqlock);
@@ -295,20 +288,13 @@ isr_unlock:
 }
 
 /* The color format (planes_cnt, buff_cnt) must be already configured. */
-static int fimc_prepare_addr(struct fimc_ctx *ctx,
-   struct fimc_vid_buffer *buf, enum v4l2_buf_type type)
+int fimc_prepare_addr(struct fimc_ctx *ctx, struct fimc_vid_buffer *buf,
+ struct fimc_frame *frame, struct fimc_addr *paddr)
 {
-   struct fimc_frame *frame;
-   struct fimc_addr *paddr;
-   u32 pix_size;
int ret = 0;
+   u32 pix_size;
 
-   frame = ctx_m2m_get_frame(ctx, type);
-   if (IS_ERR(frame))
-   return PTR_ERR(frame);
-   paddr = frame-paddr;
-
-   if (!buf)
+   if (buf == NULL || frame == NULL)
return -EINVAL;
 
pix_size = frame-width * frame-height;
@@ -344,8 +330,8 @@ static int fimc_prepare_addr(struct fimc_ctx *ctx,
}
}
 
-   dbg(PHYS_ADDR: type= %d, y= 0x%X  cb= 0x%X cr= 0x%X ret= %d,
-   type, paddr-y, paddr-cb, paddr-cr, ret);
+   dbg(PHYS_ADDR: y= 0x%X  cb= 0x%X cr= 0x%X ret= %d,
+   paddr-y, paddr-cb, paddr-cr, ret);
 
return ret;
 }
@@ -466,16 +452,14 @@ static int 

[PATCH 3/5 v4] V4L/DVB: s5p-fimc: Fix 90/270 deg rotation errors

2010-10-08 Thread Sylwester Nawrocki
Due to errorneous swapping of image dimensions the rotation
control was not handled properly in subsequent calls.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/video/s5p-fimc/fimc-core.c |   15 ++---
 drivers/media/video/s5p-fimc/fimc-reg.c  |  101 +++---
 2 files changed, 57 insertions(+), 59 deletions(-)

diff --git a/drivers/media/video/s5p-fimc/fimc-core.c 
b/drivers/media/video/s5p-fimc/fimc-core.c
index fccab13..27379a6 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -207,8 +207,13 @@ static int fimc_set_scaler_info(struct fimc_ctx *ctx)
int tx, ty, sx, sy;
int ret;
 
-   tx = d_frame-width;
-   ty = d_frame-height;
+   if (ctx-rotation == 90 || ctx-rotation == 270) {
+   ty = d_frame-width;
+   tx = d_frame-height;
+   } else {
+   tx = d_frame-width;
+   ty = d_frame-height;
+   }
if (tx = 0 || ty = 0) {
v4l2_err(ctx-fimc_dev-m2m.v4l2_dev,
invalid target size: %d x %d, tx, ty);
@@ -429,12 +434,6 @@ static int fimc_prepare_config(struct fimc_ctx *ctx, u32 
flags)
d_frame = ctx-d_frame;
 
if (flags  FIMC_PARAMS) {
-   if ((ctx-out_path == FIMC_DMA) 
-   (ctx-rotation == 90 || ctx-rotation == 270)) {
-   swap(d_frame-f_width, d_frame-f_height);
-   swap(d_frame-width, d_frame-height);
-   }
-
/* Prepare the DMA offset ratios for scaler. */
fimc_prepare_dma_offset(ctx, ctx-s_frame);
fimc_prepare_dma_offset(ctx, ctx-d_frame);
diff --git a/drivers/media/video/s5p-fimc/fimc-reg.c 
b/drivers/media/video/s5p-fimc/fimc-reg.c
index 94e98d4..95adc84 100644
--- a/drivers/media/video/s5p-fimc/fimc-reg.c
+++ b/drivers/media/video/s5p-fimc/fimc-reg.c
@@ -34,44 +34,6 @@ void fimc_hw_reset(struct fimc_dev *dev)
cfg = readl(dev-regs + S5P_CIGCTRL);
cfg = ~S5P_CIGCTRL_SWRST;
writel(cfg, dev-regs + S5P_CIGCTRL);
-
-}
-
-void fimc_hw_set_rotation(struct fimc_ctx *ctx)
-{
-   u32 cfg, flip;
-   struct fimc_dev *dev = ctx-fimc_dev;
-
-   cfg = readl(dev-regs + S5P_CITRGFMT);
-   cfg = ~(S5P_CITRGFMT_INROT90 | S5P_CITRGFMT_OUTROT90);
-
-   flip = readl(dev-regs + S5P_MSCTRL);
-   flip = ~S5P_MSCTRL_FLIP_MASK;
-
-   /*
-* The input and output rotator cannot work simultaneously.
-* Use the output rotator in output DMA mode or the input rotator
-* in direct fifo output mode.
-*/
-   if (ctx-rotation == 90 || ctx-rotation == 270) {
-   if (ctx-out_path == FIMC_LCDFIFO) {
-   cfg |= S5P_CITRGFMT_INROT90;
-   if (ctx-rotation == 270)
-   flip |= S5P_MSCTRL_FLIP_180;
-   } else {
-   cfg |= S5P_CITRGFMT_OUTROT90;
-   if (ctx-rotation == 270)
-   cfg |= S5P_CITRGFMT_FLIP_180;
-   }
-   } else if (ctx-rotation == 180) {
-   if (ctx-out_path == FIMC_LCDFIFO)
-   flip |= S5P_MSCTRL_FLIP_180;
-   else
-   cfg |= S5P_CITRGFMT_FLIP_180;
-   }
-   if (ctx-rotation == 180 || ctx-rotation == 270)
-   writel(flip, dev-regs + S5P_MSCTRL);
-   writel(cfg, dev-regs + S5P_CITRGFMT);
 }
 
 static u32 fimc_hw_get_in_flip(u32 ctx_flip)
@@ -114,6 +76,46 @@ static u32 fimc_hw_get_target_flip(u32 ctx_flip)
return flip;
 }
 
+void fimc_hw_set_rotation(struct fimc_ctx *ctx)
+{
+   u32 cfg, flip;
+   struct fimc_dev *dev = ctx-fimc_dev;
+
+   cfg = readl(dev-regs + S5P_CITRGFMT);
+   cfg = ~(S5P_CITRGFMT_INROT90 | S5P_CITRGFMT_OUTROT90 |
+ S5P_CITRGFMT_FLIP_180);
+
+   flip = readl(dev-regs + S5P_MSCTRL);
+   flip = ~S5P_MSCTRL_FLIP_MASK;
+
+   /*
+* The input and output rotator cannot work simultaneously.
+* Use the output rotator in output DMA mode or the input rotator
+* in direct fifo output mode.
+*/
+   if (ctx-rotation == 90 || ctx-rotation == 270) {
+   if (ctx-out_path == FIMC_LCDFIFO) {
+   cfg |= S5P_CITRGFMT_INROT90;
+   if (ctx-rotation == 270)
+   flip |= S5P_MSCTRL_FLIP_180;
+   } else {
+   cfg |= S5P_CITRGFMT_OUTROT90;
+   if (ctx-rotation == 270)
+   cfg |= S5P_CITRGFMT_FLIP_180;
+   }
+   } else if (ctx-rotation == 180) {
+   if (ctx-out_path == FIMC_LCDFIFO)
+   flip |= S5P_MSCTRL_FLIP_180;
+   else
+   cfg |= 

[PATCH 4/5 v4] V4L/DVB: s5p-fimc: Do not lock both buffer queues in s_fmt

2010-10-08 Thread Sylwester Nawrocki
It is not necessary to lock both capture and output buffer queue while
setting format for single queue.

Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/video/s5p-fimc/fimc-core.c |   69 +
 1 files changed, 31 insertions(+), 38 deletions(-)

diff --git a/drivers/media/video/s5p-fimc/fimc-core.c 
b/drivers/media/video/s5p-fimc/fimc-core.c
index 27379a6..23cc054 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -742,8 +742,9 @@ static int fimc_m2m_try_fmt(struct file *file, void *priv,
 static int fimc_m2m_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
 {
struct fimc_ctx *ctx = priv;
-   struct v4l2_device *v4l2_dev = ctx-fimc_dev-m2m.v4l2_dev;
-   struct videobuf_queue *src_vq, *dst_vq;
+   struct fimc_dev *fimc = ctx-fimc_dev;
+   struct v4l2_device *v4l2_dev = fimc-m2m.v4l2_dev;
+   struct videobuf_queue *vq;
struct fimc_frame *frame;
struct v4l2_pix_format *pix;
unsigned long flags;
@@ -755,69 +756,61 @@ static int fimc_m2m_s_fmt(struct file *file, void *priv, 
struct v4l2_format *f)
if (ret)
return ret;
 
-   mutex_lock(ctx-fimc_dev-lock);
+   if (mutex_lock_interruptible(fimc-lock))
+   return -ERESTARTSYS;
 
-   src_vq = v4l2_m2m_get_src_vq(ctx-m2m_ctx);
-   dst_vq = v4l2_m2m_get_dst_vq(ctx-m2m_ctx);
+   vq = v4l2_m2m_get_vq(ctx-m2m_ctx, f-type);
+   mutex_lock(vq-vb_lock);
 
-   mutex_lock(src_vq-vb_lock);
-   mutex_lock(dst_vq-vb_lock);
+   if (videobuf_queue_is_busy(vq)) {
+   v4l2_err(v4l2_dev, %s: queue (%d) busy\n, __func__, f-type);
+   ret = -EBUSY;
+   goto sf_out;
+   }
 
+   spin_lock_irqsave(ctx-slock, flags);
if (f-type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
-   if (videobuf_queue_is_busy(src_vq)) {
-   v4l2_err(v4l2_dev, %s queue busy\n, __func__);
-   ret = -EBUSY;
-   goto s_fmt_out;
-   }
frame = ctx-s_frame;
-   spin_lock_irqsave(ctx-slock, flags);
ctx-state |= FIMC_SRC_FMT;
-   spin_unlock_irqrestore(ctx-slock, flags);
-
} else if (f-type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
-   if (videobuf_queue_is_busy(dst_vq)) {
-   v4l2_err(v4l2_dev, %s queue busy\n, __func__);
-   ret = -EBUSY;
-   goto s_fmt_out;
-   }
frame = ctx-d_frame;
-   spin_lock_irqsave(ctx-slock, flags);
ctx-state |= FIMC_DST_FMT;
-   spin_unlock_irqrestore(ctx-slock, flags);
} else {
+   spin_unlock_irqrestore(ctx-slock, flags);
v4l2_err(ctx-fimc_dev-m2m.v4l2_dev,
 Wrong buffer/video queue type (%d)\n, f-type);
ret = -EINVAL;
-   goto s_fmt_out;
+   goto sf_out;
}
+   spin_unlock_irqrestore(ctx-slock, flags);
 
pix = f-fmt.pix;
frame-fmt = find_format(f);
if (!frame-fmt) {
ret = -EINVAL;
-   goto s_fmt_out;
+   goto sf_out;
}
 
-   frame-f_width = pix-bytesperline * 8 / frame-fmt-depth;
-   frame-f_height = pix-sizeimage/pix-bytesperline;
-   frame-width = pix-width;
-   frame-height = pix-height;
-   frame-o_width = pix-width;
+   frame-f_width  = pix-bytesperline * 8 / frame-fmt-depth;
+   frame-f_height = pix-height;
+   frame-width= pix-width;
+   frame-height   = pix-height;
+   frame-o_width  = pix-width;
frame-o_height = pix-height;
-   frame-offs_h = 0;
-   frame-offs_v = 0;
-   frame-size = (pix-width * pix-height * frame-fmt-depth)  3;
-   src_vq-field = dst_vq-field = pix-field;
+   frame-offs_h   = 0;
+   frame-offs_v   = 0;
+   frame-size = (pix-width * pix-height * frame-fmt-depth)  3;
+   vq-field   = pix-field;
+
spin_lock_irqsave(ctx-slock, flags);
ctx-state |= FIMC_PARAMS;
spin_unlock_irqrestore(ctx-slock, flags);
 
-   dbg(f_width= %d, f_height= %d, frame-f_width, frame-f_height);
+   dbg(f_w: %d, f_h: %d, frame-f_width, frame-f_height);
 
-s_fmt_out:
-   mutex_unlock(dst_vq-vb_lock);
-   mutex_unlock(src_vq-vb_lock);
-   mutex_unlock(ctx-fimc_dev-lock);
+sf_out:
+   mutex_unlock(vq-vb_lock);
+   mutex_unlock(fimc-lock);
return ret;
 }
 
-- 
1.7.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: OMAP 3530 camera ISP forks and new media framework

2010-10-08 Thread Bastian Hecht
   Bastian Hecht wrote:
  
I want to write a sensor driver for the mt9p031 (not mt9t031) camera
chip and start getting confused about the different kernel forks and

 There is already an mt9t031 v4l2-subdev / soc-camera driver, so, if
 mt9t031 and mt9p031 are indeed similar enough, I think, the right way is
 to join efforts to port soc-camera over to the new pad-level API and
 re-use the driver.

 Thanks
 Guennadi


That would be wonderful. As this is my first contact with v4l2 in the
kernel I keep reading through the docs and the sources to get a firmer
grasp of all the stuff here.

Thanks,

Bastian

http://www.symplektikon.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH] Audio standards on tm6000

2010-10-08 Thread Mauro Carvalho Chehab
Em 08-10-2010 16:03, Dmitri Belimov escreveu:
 Hi Mauro
 
 Not so good. Audio with this patch has bad white noise sometimes and
 bad quality. I try found better configuration for SECAM-DK.

Ok. Well, feel free to modify it. I think that this approach may be better,
especially if we need to add later some sort of code to detect and change
audio standard for some standards that have more than one audio standard
associated (we needed do to it on other drivers, in order to work in Russia
and other Countries that use different variants of the audio standard).

The association between video and audio standard is not complete. For example,
it misses NTSC-Kr and NTSC-Jp.

Cheers,
Mauro.

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] V4L/DVB: dib0700: Prevent NULL pointer dereference during probe

2010-10-08 Thread Jean Delvare
On Sun, 26 Sep 2010 16:25:53 +0200, Jean Delvare wrote:
 Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that
 dev-rc_input_dev is always set. It is, however, NULL if dvb-usb was
 loaded with option disable_rc_polling=1.
 
 Signed-off-by: Jean Delvare kh...@linux-fr.org
 Cc: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/dvb/dvb-usb/dib0700_core.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 --- linux-2.6.36-rc5.orig/drivers/media/dvb/dvb-usb/dib0700_core.c
 2010-09-24 17:17:16.0 +0200
 +++ linux-2.6.36-rc5/drivers/media/dvb/dvb-usb/dib0700_core.c 2010-09-26 
 15:04:59.0 +0200
 @@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte
   dev-props.rc.core.bulk_mode = false;
  
   /* Need a higher delay, to avoid wrong repeat */
 - dev-rc_input_dev-rep[REP_DELAY] = 500;
 + if (dev-rc_input_dev)
 + dev-rc_input_dev-rep[REP_DELAY] = 500;
  
   dib0700_rc_setup(dev);
  

The already applied commit 04cab131ce2a267b6777a98d68fbc0cae44d4ba8
(V4L/DVB: rc-core: increase repeat time) solves the problem in a
different way, so you can ignore my patch above, it is no longer needed.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] V4L/DVB: dib0700: Prevent NULL pointer dereference during probe

2010-10-08 Thread Mauro Carvalho Chehab
Em 08-10-2010 09:32, Jean Delvare escreveu:
 On Sun, 26 Sep 2010 16:25:53 +0200, Jean Delvare wrote:
 Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that
 dev-rc_input_dev is always set. It is, however, NULL if dvb-usb was
 loaded with option disable_rc_polling=1.

 Signed-off-by: Jean Delvare kh...@linux-fr.org
 Cc: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/dvb/dvb-usb/dib0700_core.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 --- linux-2.6.36-rc5.orig/drivers/media/dvb/dvb-usb/dib0700_core.c   
 2010-09-24 17:17:16.0 +0200
 +++ linux-2.6.36-rc5/drivers/media/dvb/dvb-usb/dib0700_core.c
 2010-09-26 15:04:59.0 +0200
 @@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte
  dev-props.rc.core.bulk_mode = false;
  
  /* Need a higher delay, to avoid wrong repeat */
 -dev-rc_input_dev-rep[REP_DELAY] = 500;
 +if (dev-rc_input_dev)
 +dev-rc_input_dev-rep[REP_DELAY] = 500;
  
  dib0700_rc_setup(dev);
  
 
 The already applied commit 04cab131ce2a267b6777a98d68fbc0cae44d4ba8
 (V4L/DVB: rc-core: increase repeat time) solves the problem in a
 different way, so you can ignore my patch above, it is no longer needed.
 
OK.

Yeah, we needed to move this to IR core, as other drivers were suffering the
same issue, due to RC core timeouts.

Cheers,
Mauro

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] IR: add driver for Nuvoton w836x7hg integrated CIR

2010-10-08 Thread Jarod Wilson
This is a new ir-core pnp driver for the Nuvoton w836x7hg integrated CIR
function. The chip is found on at least the ASRock ION 330HT boxes and
apparently, on a number of Intel DP55-series motherboards:

http://www.asrock.com/nettop/overview.asp?Model=ION%20330HT
http://downloadcenter.intel.com/Detail_Desc.aspx?agr=YDwnldID=17685lang=eng

This driver was made possible by a hardware donation from Nuvoton, along
with sample code (in the form of an lirc driver) and datasheet, so huge
thanks to them for supporting this effort. Note that this driver
constitutes a massive rewrite, porting from the lirc interfaces to the
ir-core interfaces, and restructuring the driver to look more like Maxim
Levitsky's ene_ir driver (as well as generally making it look more like
kernel code).

There's some work left to be done on this driver, to fully support the
range of functionality possible, but receive and IR power-on/wake are
both functional (may require setting wake key under another OS atm). The
hardware I've got (one of the ASRock boxes) only supports RX, so TX is
completely untested as of yet. Certain RX parameters, like sample
resolution and RX IRQ sample length trigger level could possibly stand
to be made tweakable via modparams or sysfs nodes, but the current
values work well enough for me w/an MCE RC6A remote.

The original lirc driver carried support for the Windows MCE IR
keyboard/mouse device, which I plan to add back generically, in a way
that should be usable by any raw IR receiver (or at least by this driver
and the mceusb driver).

Suspend and resume have also been tested, the power button on my remote
can be used to wake the machine, and CIR functionality resumes just
fine. Module unload/reload has also been tested, though not extensively
or repetitively. Also tested to work with the lirc bridge plugin for
userspace decoding.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/Kconfig   |   13 +
 drivers/media/IR/Makefile  |1 +
 drivers/media/IR/nuvoton-cir.c | 1216 
 drivers/media/IR/nuvoton-cir.h |  408 ++
 4 files changed, 1638 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/IR/nuvoton-cir.c
 create mode 100644 drivers/media/IR/nuvoton-cir.h

diff --git a/drivers/media/IR/Kconfig b/drivers/media/IR/Kconfig
index 152000d..364514a 100644
--- a/drivers/media/IR/Kconfig
+++ b/drivers/media/IR/Kconfig
@@ -113,6 +113,19 @@ config IR_IMON
   To compile this driver as a module, choose M here: the
   module will be called imon.
 
+config IR_NUVOTON
+   tristate Nuvoton w836x7hg Consumer Infrared Transceiver
+   depends on PNP
+   depends on IR_CORE
+   ---help---
+  Say Y here to enable support for integrated infrared receiver
+  /transciever made by Nuvoton (formerly Winbond). This chip is
+  found in the ASRock ION 330HT, as well as assorted Intel
+  DP55-series motherboards (and of course, possibly others).
+
+  To compile this driver as a module, choose M here: the
+  module will be called nuvoton-cir.
+
 config IR_MCEUSB
tristate Windows Media Center Ed. eHome Infrared Transceiver
depends on USB_ARCH_HAS_HCD
diff --git a/drivers/media/IR/Makefile b/drivers/media/IR/Makefile
index 953c6c4..f9574ad 100644
--- a/drivers/media/IR/Makefile
+++ b/drivers/media/IR/Makefile
@@ -17,5 +17,6 @@ obj-$(CONFIG_IR_LIRC_CODEC) += ir-lirc-codec.o
 # stand-alone IR receivers/transmitters
 obj-$(CONFIG_IR_IMON) += imon.o
 obj-$(CONFIG_IR_MCEUSB) += mceusb.o
+obj-$(CONFIG_IR_NUVOTON) += nuvoton-cir.o
 obj-$(CONFIG_IR_ENE) += ene_ir.o
 obj-$(CONFIG_IR_STREAMZAP) += streamzap.o
diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
new file mode 100644
index 000..1ce9359
--- /dev/null
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -0,0 +1,1216 @@
+/*
+ * Driver for Nuvoton Technology Corporation w83667hg/w83677hg-i CIR
+ *
+ * Copyright (C) 2010 Jarod Wilson ja...@redhat.com
+ * Copyright (C) 2009 Nuvoton PS Team
+ *
+ * Special thanks to Nuvoton for providing hardware, spec sheets and
+ * sample code upon which portions of this driver are based. Indirect
+ * thanks also to Maxim Levitsky, whose ene_ir driver this driver is
+ * modeled after.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, 

[cron job] v4l-dvb daily build 2.6.26 and up: ERRORS

2010-10-08 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Fri Oct  8 19:00:24 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15164:1da5fed5c8b2
git master:   3e6dce76d99b328716b43929b9195adfee1de00c
git media-master: 81d64d12e11a3cca995e6c752e4bd2898959ed0a
gcc version:  i686-linux-gcc (GCC) 4.5.1
host hardware:x86_64
host os:  2.6.32.5

linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.32.6-armv5: WARNINGS
linux-2.6.33-armv5: WARNINGS
linux-2.6.34-armv5: WARNINGS
linux-2.6.35.3-armv5: WARNINGS
linux-2.6.32.6-armv5-davinci: ERRORS
linux-2.6.33-armv5-davinci: ERRORS
linux-2.6.34-armv5-davinci: ERRORS
linux-2.6.35.3-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: ERRORS
linux-2.6.33-armv5-ixp: ERRORS
linux-2.6.34-armv5-ixp: ERRORS
linux-2.6.35.3-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: ERRORS
linux-2.6.33-armv5-omap2: ERRORS
linux-2.6.34-armv5-omap2: ERRORS
linux-2.6.35.3-armv5-omap2: ERRORS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.32.6-m32r: WARNINGS
linux-2.6.33-m32r: WARNINGS
linux-2.6.34-m32r: WARNINGS
linux-2.6.35.3-m32r: WARNINGS
linux-2.6.32.6-mips: WARNINGS
linux-2.6.33-mips: WARNINGS
linux-2.6.34-mips: WARNINGS
linux-2.6.35.3-mips: WARNINGS
linux-2.6.32.6-powerpc64: WARNINGS
linux-2.6.33-powerpc64: WARNINGS
linux-2.6.34-powerpc64: WARNINGS
linux-2.6.35.3-powerpc64: WARNINGS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] nuvoton-cir: add proper rx fifo overrun handling

2010-10-08 Thread Jarod Wilson
Per discussion with Andy Walls on irc, rx fifo overruns are not all that
uncommon on a busy system, and the initial posting of the nuvoton-cir
driver doesn't handle them well enough. With this addition, we'll drain
the hw fifo, attempt to process any ir pulse trains completed with that
flush, then we'll issue a hw rx fifo clear and reset the raw ir sample
kfifo and start over collecting raw ir data.

Also slightly refactors the cir interrupt enabling so that we always get
consistent flags set and only have to modify them in one place, should
they need to be altered.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/nuvoton-cir.c |   37 +
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
index 1ce9359..fdb280e 100644
--- a/drivers/media/IR/nuvoton-cir.c
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -339,6 +339,15 @@ static void nvt_clear_tx_fifo(struct nvt_dev *nvt)
nvt_cir_reg_write(nvt, val | CIR_FIFOCON_TXFIFOCLR, CIR_FIFOCON);
 }
 
+/* enable RX Trigger Level Reach and Packet End interrupts */
+static void nvt_set_cir_iren(struct nvt_dev *nvt)
+{
+   u8 iren;
+
+   iren = CIR_IREN_RTR | CIR_IREN_PE;
+   nvt_cir_reg_write(nvt, iren, CIR_IREN);
+}
+
 static void nvt_cir_regs_init(struct nvt_dev *nvt)
 {
/* set sample limit count (PE interrupt raised when reached) */
@@ -363,8 +372,8 @@ static void nvt_cir_regs_init(struct nvt_dev *nvt)
/* clear any and all stray interrupts */
nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);
 
-   /* and finally, enable RX Trigger Level Read and Packet End interrupts 
*/
-   nvt_cir_reg_write(nvt, CIR_IREN_RTR | CIR_IREN_PE, CIR_IREN);
+   /* and finally, enable interrupts */
+   nvt_set_cir_iren(nvt);
 }
 
 static void nvt_cir_wake_regs_init(struct nvt_dev *nvt)
@@ -639,12 +648,22 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
nvt_dbg_verbose(%s done, __func__);
 }
 
+static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt)
+{
+   nvt_pr(KERN_WARNING, RX FIFO overrun detected, flushing data!);
+
+   nvt-pkts = 0;
+   nvt_clear_cir_fifo(nvt);
+   ir_raw_event_reset(nvt-rdev);
+}
+
 /* copy data from hardware rx fifo into driver buffer */
 static void nvt_get_rx_ir_data(struct nvt_dev *nvt)
 {
unsigned long flags;
u8 fifocount, val;
unsigned int b_idx;
+   bool overrun = false;
int i;
 
/* Get count of how many bytes to read from RX FIFO */
@@ -652,11 +671,10 @@ static void nvt_get_rx_ir_data(struct nvt_dev *nvt)
/* if we get 0xff, probably means the logical dev is disabled */
if (fifocount == 0xff)
return;
-   /* this would suggest a fifo overrun, not good... */
+   /* watch out for a fifo overrun condition */
else if (fifocount  RX_BUF_LEN) {
-   nvt_pr(KERN_WARNING, fifocount %d over fifo len (%d)!,
-  fifocount, RX_BUF_LEN);
-   return;
+   overrun = true;
+   fifocount = RX_BUF_LEN;
}
 
nvt_dbg(attempting to fetch %u bytes from hw rx fifo, fifocount);
@@ -682,6 +700,9 @@ static void nvt_get_rx_ir_data(struct nvt_dev *nvt)
 
nvt_process_rx_ir_data(nvt);
 
+   if (overrun)
+   nvt_handle_rx_fifo_overrun(nvt);
+
spin_unlock_irqrestore(nvt-nvt_lock, flags);
 }
 
@@ -886,7 +907,7 @@ static void nvt_enable_cir(struct nvt_dev *nvt)
nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);
 
/* enable interrupts */
-   nvt_cir_reg_write(nvt, CIR_IREN_RTR | CIR_IREN_PE, CIR_IREN);
+   nvt_set_cir_iren(nvt);
 }
 
 static void nvt_disable_cir(struct nvt_dev *nvt)
@@ -1155,7 +1176,7 @@ static int nvt_resume(struct pnp_dev *pdev)
nvt_dbg(%s called, __func__);
 
/* open interrupt */
-   nvt_cir_reg_write(nvt, CIR_IREN_RTR | CIR_IREN_PE, CIR_IREN);
+   nvt_set_cir_iren(nvt);
 
/* Enable CIR logical device */
nvt_efm_enable(nvt);
-- 
1.7.1

-- 
Jarod Wilson
ja...@redhat.com

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] ov7670: remove QCIF mode

2010-10-08 Thread Daniel Drake
This super-low-resolution mode only captures from a small portion of
the sensor FOV, making it a bit useless.

Signed-off-by: Daniel Drake d...@laptop.org
---
 drivers/media/video/ov7670.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index a18dcd0..7017e5c 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -618,6 +618,7 @@ static struct ov7670_format_struct {
  * which is allegedly provided by the sensor.  So here's the weird register
  * settings.
  */
+#if 0
 static struct regval_list ov7670_qcif_regs[] = {
{ REG_COM3, COM3_SCALEEN|COM3_DCWEN },
{ REG_COM3, COM3_DCWEN },
@@ -636,6 +637,7 @@ static struct regval_list ov7670_qcif_regs[] = {
{ REG_COM13, 0xc0 },
{ 0xff, 0xff },
 };
+#endif
 
 static struct ov7670_win_size {
int width;
@@ -681,7 +683,8 @@ static struct ov7670_win_size {
.vstop  = 494,
.regs   = NULL,
},
-   /* QCIF */
+#if 0
+   /* QCIF - disabled because it only shows a small portion of sensor FOV 
*/
{
.width  = QCIF_WIDTH,
.height = QCIF_HEIGHT,
@@ -692,6 +695,7 @@ static struct ov7670_win_size {
.vstop  = 494,
.regs   = ov7670_qcif_regs,
},
+#endif
 };
 
 #define N_WIN_SIZES (ARRAY_SIZE(ov7670_win_sizes))
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] ov7670: disable QVGA mode

2010-10-08 Thread Daniel Drake
Capturing at this resolution results in an ugly green horizontal line
at the left side of the image. Disable until fixed.

http://dev.laptop.org/ticket/10231

Signed-off-by: Daniel Drake d...@laptop.org
---
 drivers/media/video/ov7670.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 7017e5c..9fffcdd 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -672,7 +672,9 @@ static struct ov7670_win_size {
.vstop  = 494,
.regs   = NULL,
},
-   /* QVGA */
+#if 0
+   /* QVGA - disabled due to ugly green line.
+* http://dev.laptop.org/ticket/10231 */
{
.width  = QVGA_WIDTH,
.height = QVGA_HEIGHT,
@@ -683,6 +685,7 @@ static struct ov7670_win_size {
.vstop  = 494,
.regs   = NULL,
},
+#endif
 #if 0
/* QCIF - disabled because it only shows a small portion of sensor FOV 
*/
{
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] ov7670: Support customization of clock speed

2010-10-08 Thread Daniel Drake
For accurate frame rate limiting, we need to know the speed of the external
clock wired into the ov7670 chip.

Add a module parameter so that the user can specify this information.
And add DMI detection for appropriate clock speeds on the OLPC XO-1 and
XO-1.5 laptops. If specified, the module parameter wins over whatever we
might have set through the DMI table.

Based on earlier work by Jonathan Corbet.

Signed-off-by: Daniel Drake d...@laptop.org
---
 drivers/media/video/ov7670.c |   71 -
 1 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 9fffcdd..c4d9ed0 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -16,6 +16,7 @@
 #include linux/i2c.h
 #include linux/delay.h
 #include linux/videodev2.h
+#include linux/dmi.h
 #include media/v4l2-device.h
 #include media/v4l2-chip-ident.h
 #include media/v4l2-mediabus.h
@@ -30,6 +31,19 @@ module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, Debug level (0-1));
 
 /*
+ * What is our fastest frame rate?  It's a function of how the chip
+ * is clocked, and this is an external clock, so we don't know. If we have
+ * a DMI entry describing the platform, use it. If not, assume 30. In both
+ * cases, accept override from a module parameter.
+ */
+static int clock_speed = 30;
+static bool clock_speed_from_param = false;
+static int set_clock_speed_from_param(const char *val, struct kernel_param 
*kp);
+module_param_call(clock_speed, set_clock_speed_from_param, param_get_int,
+ clock_speed, 0440);
+MODULE_PARM_DESC(clock_speed, External clock speed (Hz));
+
+/*
  * Basic window sizes.  These probably belong somewhere more globally
  * useful.
  */
@@ -43,11 +57,6 @@ MODULE_PARM_DESC(debug, Debug level (0-1));
 #defineQCIF_HEIGHT 144
 
 /*
- * Our nominal (default) frame rate.
- */
-#define OV7670_FRAME_RATE 30
-
-/*
  * The 7670 sits on i2c with ID 0x42
  */
 #define OV7670_I2C_ADDR 0x42
@@ -188,6 +197,44 @@ MODULE_PARM_DESC(debug, Debug level (0-1));
 #define REG_HAECC7 0xaa/* Hist AEC/AGC control 7 */
 #define REG_BD60MAX0xab/* 60hz banding step limit */
 
+static int set_clock_speed_from_param(const char *val, struct kernel_param *kp)
+{
+   int ret = param_set_int(val, kp);
+   if (ret == 0)
+   clock_speed_from_param = true;
+   return ret;
+}
+
+static int __init set_clock_speed_from_dmi(const struct dmi_system_id *dmi)
+{
+   if (clock_speed_from_param)
+   return 0; /* module param beats DMI */
+
+   clock_speed = (int) dmi-driver_data;
+   return 0;
+}
+
+static const struct dmi_system_id __initconst dmi_clock_speeds[] = {
+   {
+   .callback = set_clock_speed_from_dmi,
+   .driver_data = (void *) 45,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, OLPC),
+   DMI_MATCH(DMI_PRODUCT_NAME, XO),
+   DMI_MATCH(DMI_PRODUCT_VERSION, 1),
+   },
+   },
+   {
+   .callback = set_clock_speed_from_dmi,
+   .driver_data = (void *) 90,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, OLPC),
+   DMI_MATCH(DMI_PRODUCT_NAME, XO),
+   DMI_MATCH(DMI_PRODUCT_VERSION, 1.5),
+   },
+   },
+   { }
+};
 
 /*
  * Information we maintain about a known sensor.
@@ -861,7 +908,7 @@ static int ov7670_g_parm(struct v4l2_subdev *sd, struct 
v4l2_streamparm *parms)
memset(cp, 0, sizeof(struct v4l2_captureparm));
cp-capability = V4L2_CAP_TIMEPERFRAME;
cp-timeperframe.numerator = 1;
-   cp-timeperframe.denominator = OV7670_FRAME_RATE;
+   cp-timeperframe.denominator = clock_speed;
if ((info-clkrc  CLK_EXT) == 0  (info-clkrc  CLK_SCALE)  1)
cp-timeperframe.denominator /= (info-clkrc  CLK_SCALE);
return 0;
@@ -882,14 +929,14 @@ static int ov7670_s_parm(struct v4l2_subdev *sd, struct 
v4l2_streamparm *parms)
if (tpf-numerator == 0 || tpf-denominator == 0)
div = 1;  /* Reset to full rate */
else
-   div = (tpf-numerator*OV7670_FRAME_RATE)/tpf-denominator;
+   div = (tpf-numerator*clock_speed)/tpf-denominator;
if (div == 0)
div = 1;
else if (div  CLK_SCALE)
div = CLK_SCALE;
info-clkrc = (info-clkrc  0x80) | div;
tpf-numerator = 1;
-   tpf-denominator = OV7670_FRAME_RATE/div;
+   tpf-denominator = clock_speed/div;
return ov7670_write(sd, REG_CLKRC, info-clkrc);
 }
 
@@ -1510,10 +1557,15 @@ static int ov7670_probe(struct i2c_client *client,
}
v4l_info(client, chip found @ 0x%02x (%s)\n,
client-addr  1, client-adapter-name);
+   /*
+* Make sure the clock speed is rational.
+*/
+  

Passing info from main dev to subdev

2010-10-08 Thread Daniel Drake
Hi,

The cafe_ccic + ov7670 combination is currently broken in mainstream
on the OLPC XO-1 laptop because of it's move to i2c (2bf7de4), in
order to work on the new XO-1.5 laptop. The smbus IO code was brought
back in 467142093 but this code is never triggered - CONFIG_OLPC_XO_1
doesn't exist.

I would like to do this at runtime, since we should aim to have a
kernel that can run on both XO-1 and XO-1.5.
So, I would like ov7670 to support both methods (i2c and smbus) and
for the parent device (cafe_ccic on XO-1, via-camera on XO-1.5) to
declare which one to use.

So my question: how can I communicate such info from parent to subdev?
Just the value of 1 variable would be enough.

Thanks,
Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] ov7670: remove QCIF mode

2010-10-08 Thread Jonathan Corbet
On Fri,  8 Oct 2010 22:04:12 +0100 (BST)
Daniel Drake d...@laptop.org wrote:

 This super-low-resolution mode only captures from a small portion of
 the sensor FOV, making it a bit useless.

I'm certainly not attached to this mode, but...does it harm anybody if
it's there?

ov7670 sensors appear in settings other than OLPC, so I'd be reluctant
to take this out unless there's some real reason to.

jon
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] IR/lirc: further ioctl portability fixups

2010-10-08 Thread Jarod Wilson
From: Joris van Rantwijk jorisp...@xs4all.nl

8
I tested lirc_serial and found that it works fine.
Except the LIRC ioctls do not work in my 64-bit-kernel/32-bit-user
setup. I added compat_ioctl entries in the drivers to fix this.

While doing so, I noticed inconsistencies in the argument type of
the LIRC ioctls. All ioctls are declared in lirc.h as having argument
type __u32, however there are a few places where the driver calls
get_user/put_user with an unsigned long argument.

The patch below changes lirc_dev and lirc_serial to use __u32 for all
ioctl arguments, and adds compat_ioctl entries.
It should probably also be done in the other low-level drivers,
but I don't have hardware to test those.
8

I've dropped the .compat_ioctl addition from Joris' original patch,
as I swear the non-compat definition should now work for both 32-bit
and 64-bit userspace. Technically, I think we still need/want a
Signed-off-by: from Joris here. Joris? (And sorry for the lengthy delay
in getting a reply to you).

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/ir-lirc-codec.c |   10 +-
 drivers/media/IR/lirc_dev.c  |   14 +++---
 include/media/lirc_dev.h |4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index e63f757..c6d5b3e 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -102,7 +102,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int 
cmd,
struct ir_input_dev *ir_dev;
int ret = 0;
void *drv_data;
-   unsigned long val = 0;
+   __u32 val = 0;
 
lirc = lirc_get_pdata(filep);
if (!lirc)
@@ -115,7 +115,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int 
cmd,
drv_data = ir_dev-props-priv;
 
if (_IOC_DIR(cmd)  _IOC_WRITE) {
-   ret = get_user(val, (unsigned long *)arg);
+   ret = get_user(val, (__u32 *)arg);
if (ret)
return ret;
}
@@ -135,14 +135,14 @@ static long ir_lirc_ioctl(struct file *filep, unsigned 
int cmd,
/* TX settings */
case LIRC_SET_TRANSMITTER_MASK:
if (ir_dev-props-s_tx_mask)
-   ret = ir_dev-props-s_tx_mask(drv_data, (u32)val);
+   ret = ir_dev-props-s_tx_mask(drv_data, val);
else
return -EINVAL;
break;
 
case LIRC_SET_SEND_CARRIER:
if (ir_dev-props-s_tx_carrier)
-   ir_dev-props-s_tx_carrier(drv_data, (u32)val);
+   ir_dev-props-s_tx_carrier(drv_data, val);
else
return -EINVAL;
break;
@@ -212,7 +212,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int 
cmd,
}
 
if (_IOC_DIR(cmd)  _IOC_READ)
-   ret = put_user(val, (unsigned long *)arg);
+   ret = put_user(val, (__u32 *)arg);
 
return ret;
 }
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c
index 0572053..e4e4d99 100644
--- a/drivers/media/IR/lirc_dev.c
+++ b/drivers/media/IR/lirc_dev.c
@@ -524,7 +524,7 @@ EXPORT_SYMBOL(lirc_dev_fop_poll);
 
 long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-   unsigned long mode;
+   __u32 mode;
int result = 0;
struct irctl *ir = file-private_data;
 
@@ -541,7 +541,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
switch (cmd) {
case LIRC_GET_FEATURES:
-   result = put_user(ir-d.features, (unsigned long *)arg);
+   result = put_user(ir-d.features, (__u32 *)arg);
break;
case LIRC_GET_REC_MODE:
if (!(ir-d.features  LIRC_CAN_REC_MASK)) {
@@ -551,7 +551,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
result = put_user(LIRC_REC2MODE
  (ir-d.features  LIRC_CAN_REC_MASK),
- (unsigned long *)arg);
+ (__u32 *)arg);
break;
case LIRC_SET_REC_MODE:
if (!(ir-d.features  LIRC_CAN_REC_MASK)) {
@@ -559,7 +559,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
break;
}
 
-   result = get_user(mode, (unsigned long *)arg);
+   result = get_user(mode, (__u32 *)arg);
if (!result  !(LIRC_MODE2REC(mode)  ir-d.features))
result = -EINVAL;
/*
@@ -568,7 +568,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 */
break;
case LIRC_GET_LENGTH:
-   result = 

Re: [PATCH 2/3] ov7670: disable QVGA mode

2010-10-08 Thread Jonathan Corbet
On Fri,  8 Oct 2010 22:04:18 +0100 (BST)
Daniel Drake d...@laptop.org wrote:

 Capturing at this resolution results in an ugly green horizontal line
 at the left side of the image. Disable until fixed.

A problem like that will be at the controller level, not the sensor
level.  Given that this is an XO-1 report, I'd assume something
requires tweaking in the cafe_ccic driver.  I wasn't aware of this; I
know it worked once upon a time.

Again, given that ov7670 sensors can appear elsewhere, I'd be inclined
not to turn off this functionality because of this problem.

jon
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] ov7670: Support customization of clock speed

2010-10-08 Thread Jonathan Corbet
On Fri,  8 Oct 2010 22:04:32 +0100 (BST)
Daniel Drake d...@laptop.org wrote:

 Add a module parameter so that the user can specify this information.
 And add DMI detection for appropriate clock speeds on the OLPC XO-1 and
 XO-1.5 laptops. If specified, the module parameter wins over whatever we
 might have set through the DMI table.

This certainly seems better than my hack.

Acked-by: Jonathan Corbet cor...@lwn.net

jon
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] ov7670: remove QCIF mode

2010-10-08 Thread Daniel Drake
On 8 October 2010 22:11, Jonathan Corbet cor...@lwn.net wrote:
 I'm certainly not attached to this mode, but...does it harm anybody if
 it's there?

Yes. Applications like gstreamer will pick this resolution if its the
closest resolution to the target file resolution. On XO-1 we always
pick a low res so gstreamer picks this one. And we end up with a video
that only records a miniscule portion of the FOV.

All the other settings of the camera scale the image so that the whole
FOV is covered. But this one records at normal resolution, only
sending a small center portion of the FOV. The same pixels can be read
by recording at full res and then just cutting out the center bit.

Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] staging/lirc: ioctl portability fixups

2010-10-08 Thread Jarod Wilson

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/staging/lirc/lirc_it87.c |   17 -
 drivers/staging/lirc/lirc_ite8709.c  |6 +++---
 drivers/staging/lirc/lirc_parallel.c |   32 
 drivers/staging/lirc/lirc_serial.c   |   21 ++---
 drivers/staging/lirc/lirc_sir.c  |   21 ++---
 5 files changed, 47 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/lirc/lirc_it87.c b/drivers/staging/lirc/lirc_it87.c
index ec11c0e..7d1b427 100644
--- a/drivers/staging/lirc/lirc_it87.c
+++ b/drivers/staging/lirc/lirc_it87.c
@@ -239,8 +239,7 @@ static ssize_t lirc_write(struct file *file, const char 
*buf,
 static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
int retval = 0;
-   unsigned long value = 0;
-   unsigned int ivalue;
+   __u32 value = 0;
unsigned long hw_flags;
 
if (cmd == LIRC_GET_FEATURES)
@@ -256,24 +255,24 @@ static long lirc_ioctl(struct file *filep, unsigned int 
cmd, unsigned long arg)
case LIRC_GET_FEATURES:
case LIRC_GET_SEND_MODE:
case LIRC_GET_REC_MODE:
-   retval = put_user(value, (unsigned long *) arg);
+   retval = put_user(value, (__u32 *) arg);
break;
 
case LIRC_SET_SEND_MODE:
case LIRC_SET_REC_MODE:
-   retval = get_user(value, (unsigned long *) arg);
+   retval = get_user(value, (__u32 *) arg);
break;
 
case LIRC_SET_SEND_CARRIER:
-   retval = get_user(ivalue, (unsigned int *) arg);
+   retval = get_user(value, (__u32 *) arg);
if (retval)
return retval;
-   ivalue /= 1000;
-   if (ivalue  IT87_CIR_FREQ_MAX ||
-   ivalue  IT87_CIR_FREQ_MIN)
+   value /= 1000;
+   if (value  IT87_CIR_FREQ_MAX ||
+   value  IT87_CIR_FREQ_MIN)
return -EINVAL;
 
-   it87_freq = ivalue;
+   it87_freq = value;
 
spin_lock_irqsave(hardware_lock, hw_flags);
outb(((inb(io + IT87_CIR_TCR2)  IT87_CIR_TCR2_TXMPW) |
diff --git a/drivers/staging/lirc/lirc_ite8709.c 
b/drivers/staging/lirc/lirc_ite8709.c
index 9352f45..cb20cfd 100644
--- a/drivers/staging/lirc/lirc_ite8709.c
+++ b/drivers/staging/lirc/lirc_ite8709.c
@@ -102,8 +102,8 @@ struct ite8709_device {
int io;
int irq;
spinlock_t hardware_lock;
-   unsigned long long acc_pulse;
-   unsigned long long acc_space;
+   __u64 acc_pulse;
+   __u64 acc_space;
char lastbit;
struct timeval last_tv;
struct lirc_driver driver;
@@ -220,7 +220,7 @@ static void ite8709_set_use_dec(void *data)
 }
 
 static void ite8709_add_read_queue(struct ite8709_device *dev, int flag,
-   unsigned long long val)
+  __u64 val)
 {
int value;
 
diff --git a/drivers/staging/lirc/lirc_parallel.c 
b/drivers/staging/lirc/lirc_parallel.c
index 6da4a8c..be3d60d 100644
--- a/drivers/staging/lirc/lirc_parallel.c
+++ b/drivers/staging/lirc/lirc_parallel.c
@@ -301,9 +301,9 @@ static void irq_handler(void *blah)
 
if (signal != 0) {
/* ajust value to usecs */
-   unsigned long long helper;
+   __u64 helper;
 
-   helper = ((unsigned long long) signal)*100;
+   helper = ((__u64) signal)*100;
do_div(helper, timer);
signal = (long) helper;
 
@@ -404,9 +404,9 @@ static ssize_t lirc_write(struct file *filep, const char 
*buf, size_t n,
 
/* adjust values from usecs */
for (i = 0; i  count; i++) {
-   unsigned long long helper;
+   __u64 helper;
 
-   helper = ((unsigned long long) wbuf[i])*timer;
+   helper = ((__u64) wbuf[i])*timer;
do_div(helper, 100);
wbuf[i] = (int) helper;
}
@@ -464,48 +464,48 @@ static unsigned int lirc_poll(struct file *file, 
poll_table *wait)
 static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
int result;
-   unsigned long features = LIRC_CAN_SET_TRANSMITTER_MASK |
-LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
-   unsigned long mode;
-   unsigned int ivalue;
+   __u32 features = LIRC_CAN_SET_TRANSMITTER_MASK |
+LIRC_CAN_SEND_PULSE | LIRC_CAN_REC_MODE2;
+   __u32 mode;
+   __u32 value;
 
switch (cmd) {
case LIRC_GET_FEATURES:
-   result = put_user(features, (unsigned long *) arg);
+   result = put_user(features, (__u32 *) arg);
if (result)
return result;
break;
case LIRC_GET_SEND_MODE:
-   

Re: [PATCH 2/3] ov7670: disable QVGA mode

2010-10-08 Thread Daniel Drake
On 8 October 2010 22:13, Jonathan Corbet cor...@lwn.net wrote:
 A problem like that will be at the controller level, not the sensor
 level.  Given that this is an XO-1 report, I'd assume something
 requires tweaking in the cafe_ccic driver.  I wasn't aware of this; I
 know it worked once upon a time.

I reported it 3 months ago
http://dev.laptop.org/ticket/10231

Are you interested in working on this?
I'd have no idea where to start.

I'm not so convinced that it's a controller problem rather than a
sensor one, given that it says the sensor register values were
determined empirically rather than from docs.

Thanks,
Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL REQUEST] IR patches for 2.6.37-rc1

2010-10-08 Thread Jarod Wilson
Hey Mauro,

I've queued up some lirc fixes and a couple of patches that add a new
ir-core driver for the Nuvoton w836x7hg Super I/O integrated CIR
functionality. All but the Kconfig re-sorting patch have been posted to
linux-media for review, but I'm hoping they can all get merged in time for
the 2.6.37-rc1 window, and any additional review feedback can be taken
care of with follow-up patches.

The following changes since commit b9a1211dff08aa73fc26db66980ec0710a6c7134:

  V4L/DVB: Staging: cx25821: fix braces and space coding style issues 
(2010-10-07 15:37:27 -0300)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jarod/linux-2.6-lirc.git staging

Jarod Wilson (5):
  IR: add driver for Nuvoton w836x7hg integrated CIR
  nuvoton-cir: add proper rx fifo overrun handling
  IR/Kconfig: sort hardware entries alphabetically
  IR/lirc: further ioctl portability fixups
  staging/lirc: ioctl portability fixups

 drivers/media/IR/Kconfig |   27 +-
 drivers/media/IR/Makefile|1 +
 drivers/media/IR/ir-lirc-codec.c |   10 +-
 drivers/media/IR/lirc_dev.c  |   14 +-
 drivers/media/IR/nuvoton-cir.c   | 1237 ++
 drivers/media/IR/nuvoton-cir.h   |  408 +++
 drivers/staging/lirc/lirc_it87.c |   17 +-
 drivers/staging/lirc/lirc_ite8709.c  |6 +-
 drivers/staging/lirc/lirc_parallel.c |   32 +-
 drivers/staging/lirc/lirc_serial.c   |   21 +-
 drivers/staging/lirc/lirc_sir.c  |   21 +-
 include/media/lirc_dev.h |4 +-
 12 files changed, 1727 insertions(+), 71 deletions(-)
 create mode 100644 drivers/media/IR/nuvoton-cir.c
 create mode 100644 drivers/media/IR/nuvoton-cir.h

-- 
Jarod Wilson
ja...@redhat.com

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hg slow commit

2010-10-08 Thread Douglas Schilling Landgraf
Hello everyone,

Most of you should asking yourself why the hg commit are very slow.
Unfortunately, I had a business trip (out of my country) in the last 3
weeks. Now, I am back
and I will restart the commits and read all my emails. If you guys
want to help me or
have free time to do this, please let me know. Sorry for the inconvenient.

Cheers
Douglas
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: hg slow commit

2010-10-08 Thread VDR User
On Fri, Oct 8, 2010 at 6:32 PM, Douglas Schilling Landgraf
dougsl...@gmail.com wrote:
 Hello everyone,

        Most of you should asking yourself why the hg commit are very slow.
 Unfortunately, I had a business trip (out of my country) in the last 3
 weeks. Now, I am back
 and I will restart the commits and read all my emails. If you guys
 want to help me or
 have free time to do this, please let me know. Sorry for the inconvenient.

Welcome back and thanks for the update.  I was wondering if anything
ever happened with writing some scripts to ease the pain of all the
backporting?

Cheers,
Derek
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] V4L/DVB: tvp5150: COMPOSITE0 input should not force-enable TV mode

2010-10-08 Thread Paul Walmsley

When digitizing composite video from a analog videotape source using the 
TVP5150's first composite input channel, the captured stream exhibits 
tearing and synchronization problems[1].

It turns out that commit c0477ad9feca01bd8eff95d7482c33753d05c700 caused 
TV mode (as opposed to VCR mode or auto-detect) to be forcibly 
enabled for both composite inputs.  According to the chip 
documentation[2], TV mode disables a chrominance trap input filter, 
which appears to be necessary for high-quality video capture from an 
analog videotape source.  [ Commit 
c7c0b34c27bbf0671807e902fbfea6270c8f138d subsequently restricted the 
problem to the first composite input, apparently inadvertently. ]

Since any type of composite signal source can be connected to the 
TVP5150's first composite input, unconditionally forcing TV mode isn't 
correct.  There doesn't appear to be a good way for applications to tell 
the driver what is connected.  Fortunately, the TVP5150 has an operating 
mode auto-detection feature, which, when enabled, should cause the TVP5150 
to auto-detect whether it should use VCR mode or TV mode.  Enabling 
operating mode auto-detection improved video capture quality 
significantly[3].

Therefore, fix this bug by using operating mode auto-detection. (Also, 
while here, fix a CodingStyle issue.)

For those users who may find this patch via a mailing list archive but who 
are not able to upgrade to a kernel with a fixed driver: the TVP5150's 
S-Video and second composite input sources have auto-detection enabled, so 
you may wish to try using those -- if available on your device -- until 
this fix makes it a downstream distribution near you.

References:

1. Pre-patch tvtime snapshot using a Pinnacle PCTV HD Pro as the
   capture device and a Sony EV-S2000 as a video source:
   http://www.booyaka.com/~paul/tvp5150/1a.png

2. Section 3.21.3, Operation Mode Control Register, _TVP5150AM1
   Ultralow-Power NTSC/PAL/SECAM Video Decoder (Rev. D)_ [SLES209D],
   downloaded 8 October 2010, available via
   http://focus.ti.com/lit/ds/symlink/tvp5150am1.pdf

3. Post-patch tvtime snapshot (same signal chain as #1, above):
   http://www.booyaka.com/~paul/tvp5150/1b.png

Signed-off-by: Paul Walmsley p...@booyaka.com
Cc: Hans Verkuil hverk...@xs4all.nl
Cc: Mauro Carvalho Chehab mche...@redhat.com

---
 drivers/media/video/tvp5150.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index 1654f65..e4dfb67 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -277,7 +277,7 @@ static int tvp5150_log_status(struct v4l2_subdev *sd)
 
 static inline void tvp5150_selmux(struct v4l2_subdev *sd)
 {
-   int opmode=0;
+   int opmode = 0;
struct tvp5150 *decoder = to_tvp5150(sd);
int input = 0;
unsigned char val;
@@ -290,12 +290,10 @@ static inline void tvp5150_selmux(struct v4l2_subdev *sd)
input |= 2;
/* fall through */
case TVP5150_COMPOSITE0:
-   opmode=0x30;/* TV Mode */
break;
case TVP5150_SVIDEO:
default:
input |= 1;
-   opmode=0;   /* Auto Mode */
break;
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html