[linuxtv-commits] [hg:v4l-dvb] videodev: improve extended control support in video_ioctl2()

2008-06-27 Thread Patch from Hans Verkuil
The patch number 8112 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
videodev: improve extended control support in video_ioctl2()



- add sanity checks for the extended controls argument.
- if the driver only supports extended controls, then convert
  old-style controls to an extended control callback.


Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/videodev.c |   91 +--
 1 file changed, 74 insertions(+), 17 deletions(-)

diff -r 6742fedbc990 -r fae200f98d47 linux/drivers/media/video/videodev.c
--- a/linux/drivers/media/video/videodev.c  Wed Jun 25 08:00:17 2008 +0200
+++ b/linux/drivers/media/video/videodev.c  Wed Jun 25 08:29:01 2008 +0200
@@ -748,6 +748,29 @@ static inline void v4l_print_ext_ctrls(u
printk(KERN_CONT \n);
 };
 
+static inline int check_ext_ctrls(struct v4l2_ext_controls *c)
+{
+   __u32 i;
+
+   /* zero the reserved fields */
+   c-reserved[0] = c-reserved[1] = 0;
+   for (i = 0; i  c-count; i++) {
+   c-controls[i].reserved2[0] = 0;
+   c-controls[i].reserved2[1] = 0;
+   }
+   /* V4L2_CID_PRIVATE_BASE cannot be used as control class
+* when using extended controls. */
+   if (c-ctrl_class == V4L2_CID_PRIVATE_BASE)
+   return 0;
+   /* Check that all controls are from the same control class. */
+   for (i = 0; i  c-count; i++) {
+   if (V4L2_CTRL_ID2CLASS(c-controls[i].id) != c-ctrl_class) {
+   c-error_idx = i;
+   return 0;
+   }
+   }
+   return 1;
+}
 
 static int check_fmt (struct video_device *vfd, enum v4l2_buf_type type)
 {
@@ -1430,10 +1453,24 @@ static int __video_do_ioctl(struct inode
{
struct v4l2_control *p = arg;
 
-   if (!vfd-vidioc_g_ctrl)
-   break;
-
-   ret = vfd-vidioc_g_ctrl(file, fh, p);
+   if (vfd-vidioc_g_ctrl)
+   ret = vfd-vidioc_g_ctrl(file, fh, p);
+   else if (vfd-vidioc_g_ext_ctrls) {
+   struct v4l2_ext_controls ctrls;
+   struct v4l2_ext_control ctrl;
+
+   ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p-id);
+   ctrls.count = 1;
+   ctrls.controls = ctrl;
+   ctrl.id = p-id;
+   ctrl.value = p-value;
+   if (check_ext_ctrls(ctrls)) {
+   ret = vfd-vidioc_g_ext_ctrls(file, fh, ctrls);
+   if (ret == 0)
+   p-value = ctrl.value;
+   }
+   } else
+   break;
if (!ret)
dbgarg(cmd, id=0x%x, value=%d\n, p-id, p-value);
else
@@ -1443,21 +1480,39 @@ static int __video_do_ioctl(struct inode
case VIDIOC_S_CTRL:
{
struct v4l2_control *p = arg;
-
-   if (!vfd-vidioc_s_ctrl)
-   break;
+   struct v4l2_ext_controls ctrls;
+   struct v4l2_ext_control ctrl;
+
+   if (!vfd-vidioc_s_ctrl  !vfd-vidioc_s_ext_ctrls)
+   break;
+
dbgarg(cmd, id=0x%x, value=%d\n, p-id, p-value);
 
-   ret = vfd-vidioc_s_ctrl(file, fh, p);
+   if (vfd-vidioc_s_ctrl) {
+   ret = vfd-vidioc_s_ctrl(file, fh, p);
+   break;
+   }
+   if (!vfd-vidioc_s_ext_ctrls)
+   break;
+
+   ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p-id);
+   ctrls.count = 1;
+   ctrls.controls = ctrl;
+   ctrl.id = p-id;
+   ctrl.value = p-value;
+   if (check_ext_ctrls(ctrls))
+   ret = vfd-vidioc_s_ext_ctrls(file, fh, ctrls);
break;
}
case VIDIOC_G_EXT_CTRLS:
{
struct v4l2_ext_controls *p = arg;
 
+   p-error_idx = p-count;
if (!vfd-vidioc_g_ext_ctrls)
break;
-   ret = vfd-vidioc_g_ext_ctrls(file, fh, p);
+   if (check_ext_ctrls(p))
+   ret = vfd-vidioc_g_ext_ctrls(file, fh, p);
v4l_print_ext_ctrls(cmd, vfd, p, !ret);
break;
}
@@ -1465,22 +1520,24 @@ static int __video_do_ioctl(struct inode
{
struct v4l2_ext_controls *p 

[linuxtv-commits] [hg:v4l-dvb] ivtv/cx18: fix compile error when CONFIG_VIDEO_ADV_DEBUG is not defined.

2008-06-27 Thread Patch from Hans Verkuil
The patch number 8111 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
ivtv/cx18: fix compile error when CONFIG_VIDEO_ADV_DEBUG is not defined.


Thanks to Randy Dunlap for reporting this.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-ioctl.c |   42 +++---
 linux/drivers/media/video/ivtv/ivtv-ioctl.c |   59 ++--
 2 files changed, 54 insertions(+), 47 deletions(-)

diff -r 49ea64868f0c -r 6742fedbc990 linux/drivers/media/video/cx18/cx18-ioctl.c
--- a/linux/drivers/media/video/cx18/cx18-ioctl.c   Mon Jun 23 09:31:29 
2008 -0300
+++ b/linux/drivers/media/video/cx18/cx18-ioctl.c   Wed Jun 25 08:00:17 
2008 +0200
@@ -128,25 +128,6 @@ u16 cx18_get_service_set(struct v4l2_sli
return set;
 }
 
-static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
-{
-   struct v4l2_register *regs = arg;
-   unsigned long flags;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EPERM;
-   if (regs-reg = CX18_MEM_OFFSET + CX18_MEM_SIZE)
-   return -EINVAL;
-
-   spin_lock_irqsave(cx18_cards_lock, flags);
-   if (cmd == VIDIOC_DBG_G_REGISTER)
-   regs-val = read_enc(regs-reg);
-   else
-   write_enc(regs-val, regs-reg);
-   spin_unlock_irqrestore(cx18_cards_lock, flags);
-   return 0;
-}
-
 static int cx18_g_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_format *fmt)
 {
@@ -364,6 +345,26 @@ static int cx18_g_chip_ident(struct file
return -EINVAL;
 }
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
+{
+   struct v4l2_register *regs = arg;
+   unsigned long flags;
+
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   if (regs-reg = CX18_MEM_OFFSET + CX18_MEM_SIZE)
+   return -EINVAL;
+
+   spin_lock_irqsave(cx18_cards_lock, flags);
+   if (cmd == VIDIOC_DBG_G_REGISTER)
+   regs-val = read_enc(regs-reg);
+   else
+   write_enc(regs-val, regs-reg);
+   spin_unlock_irqrestore(cx18_cards_lock, flags);
+   return 0;
+}
+
 static int cx18_g_register(struct file *file, void *fh,
struct v4l2_register *reg)
 {
@@ -391,6 +392,7 @@ static int cx18_s_register(struct file *
return cx18_call_i2c_client(cx, reg-match_chip, VIDIOC_DBG_S_REGISTER,
reg);
 }
+#endif
 
 static int cx18_g_priority(struct file *file, void *fh, enum v4l2_priority *p)
 {
@@ -915,8 +917,10 @@ void cx18_set_funcs(struct video_device 
vdev-vidioc_try_fmt_sliced_vbi_cap  = cx18_try_fmt_sliced_vbi_cap;
vdev-vidioc_g_sliced_vbi_cap= cx18_g_sliced_vbi_cap;
vdev-vidioc_g_chip_ident= cx18_g_chip_ident;
+#ifdef CONFIG_VIDEO_ADV_DEBUG
vdev-vidioc_g_register  = cx18_g_register;
vdev-vidioc_s_register  = cx18_s_register;
+#endif
vdev-vidioc_default = cx18_default;
vdev-vidioc_queryctrl   = cx18_queryctrl;
vdev-vidioc_querymenu   = cx18_querymenu;
diff -r 49ea64868f0c -r 6742fedbc990 linux/drivers/media/video/ivtv/ivtv-ioctl.c
--- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c   Mon Jun 23 09:31:29 
2008 -0300
+++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c   Wed Jun 25 08:00:17 
2008 +0200
@@ -314,34 +314,6 @@ static int ivtv_video_command(struct ivt
return 0;
 }
 
-static int ivtv_itvc(struct ivtv *itv, unsigned int cmd, void *arg)
-{
-   struct v4l2_register *regs = arg;
-   unsigned long flags;
-   volatile u8 __iomem *reg_start;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EPERM;
-   if (regs-reg = IVTV_REG_OFFSET  regs-reg  IVTV_REG_OFFSET + 
IVTV_REG_SIZE)
-   reg_start = itv-reg_mem - IVTV_REG_OFFSET;
-   else if (itv-has_cx23415  regs-reg = IVTV_DECODER_OFFSET 
-   regs-reg  IVTV_DECODER_OFFSET + IVTV_DECODER_SIZE)
-   reg_start = itv-dec_mem - IVTV_DECODER_OFFSET;
-   else if (regs-reg = 0  regs-reg  IVTV_ENCODER_SIZE)
-   reg_start = itv-enc_mem;
-   else
-   return -EINVAL;
-
-   spin_lock_irqsave(ivtv_cards_lock, flags);
-   if (cmd == VIDIOC_DBG_G_REGISTER) {
-   regs-val = readl(regs-reg + reg_start);
-   } else {
-   writel(regs-val, regs-reg + reg_start);
-   }
-   spin_unlock_irqrestore(ivtv_cards_lock, flags);
-   return 0;
-}
-

[linuxtv-commits] [hg:v4l-dvb] ivtv/cx18: remove s/g_ctrl, now all controls are handled through s/g_ext_ctrl

2008-06-27 Thread Patch from Hans Verkuil
The patch number 8113 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
ivtv/cx18: remove s/g_ctrl, now all controls are handled through s/g_ext_ctrl


videodev converts old-style controls to an extended control so the ivtv and
cx18 drivers no longer have to handle both.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-controls.c |   51 +++--
 linux/drivers/media/video/cx18/cx18-controls.h |2 
 linux/drivers/media/video/cx18/cx18-ioctl.c|2 
 linux/drivers/media/video/ivtv/ivtv-controls.c |   45 +++
 linux/drivers/media/video/ivtv/ivtv-controls.h |2 
 linux/drivers/media/video/ivtv/ivtv-ioctl.c|4 -
 6 files changed, 71 insertions(+), 35 deletions(-)

diff -r fae200f98d47 -r 248d809f4282 
linux/drivers/media/video/cx18/cx18-controls.c
--- a/linux/drivers/media/video/cx18/cx18-controls.cWed Jun 25 08:29:01 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-controls.cWed Jun 25 08:32:44 
2008 +0200
@@ -101,16 +101,24 @@ int cx18_querymenu(struct file *file, vo
cx2341x_ctrl_get_menu(cx-params, qmenu-id));
 }
 
-int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
-{
-   struct cx18_open_id *id = fh;
-   struct cx18 *cx = id-cx;
-   int ret;
-
-   ret = v4l2_prio_check(cx-prio, id-prio);
-   if (ret)
-   return ret;
-
+static int cx18_try_ctrl(struct file *file, void *fh,
+   struct v4l2_ext_control *vctrl)
+{
+   struct v4l2_queryctrl qctrl;
+   const char **menu_items = NULL;
+   int err;
+
+   qctrl.id = vctrl-id;
+   err = cx18_queryctrl(file, fh, qctrl);
+   if (err)
+   return err;
+   if (qctrl.type == V4L2_CTRL_TYPE_MENU)
+   menu_items = v4l2_ctrl_get_menu(qctrl.id);
+   return v4l2_ctrl_check(vctrl, qctrl, menu_items);
+}
+
+static int cx18_s_ctrl(struct cx18 *cx, struct v4l2_control *vctrl)
+{
switch (vctrl-id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
@@ -134,10 +142,8 @@ int cx18_s_ctrl(struct file *file, void 
return 0;
 }
 
-int cx18_g_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
-{
-   struct cx18 *cx = ((struct cx18_open_id *)fh)-cx;
-
+static int cx18_g_ctrl(struct cx18 *cx, struct v4l2_control *vctrl)
+{
switch (vctrl-id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
@@ -211,7 +217,7 @@ int cx18_g_ext_ctrls(struct file *file, 
for (i = 0; i  c-count; i++) {
ctrl.id = c-controls[i].id;
ctrl.value = c-controls[i].value;
-   err = cx18_g_ctrl(file, fh, ctrl);
+   err = cx18_g_ctrl(cx, ctrl);
c-controls[i].value = ctrl.value;
if (err) {
c-error_idx = i;
@@ -243,7 +249,7 @@ int cx18_s_ext_ctrls(struct file *file, 
for (i = 0; i  c-count; i++) {
ctrl.id = c-controls[i].id;
ctrl.value = c-controls[i].value;
-   err = cx18_s_ctrl(file, fh, ctrl);
+   err = cx18_s_ctrl(cx, ctrl);
c-controls[i].value = ctrl.value;
if (err) {
c-error_idx = i;
@@ -287,6 +293,19 @@ int cx18_try_ext_ctrls(struct file *file
 {
struct cx18 *cx = ((struct cx18_open_id *)fh)-cx;
 
+   if (c-ctrl_class == V4L2_CTRL_CLASS_USER) {
+   int i;
+   int err = 0;
+
+   for (i = 0; i  c-count; i++) {
+   err = cx18_try_ctrl(file, fh, c-controls[i]);
+   if (err) {
+   c-error_idx = i;
+   break;
+   }
+   }
+   return err;
+   }
if (c-ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(cx-params,
atomic_read(cx-ana_capturing),
diff -r fae200f98d47 -r 248d809f4282 
linux/drivers/media/video/cx18/cx18-controls.h
--- a/linux/drivers/media/video/cx18/cx18-controls.hWed Jun 25 08:29:01 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-controls.hWed Jun 25 08:32:44 
2008 +0200
@@ -22,8 +22,6 @@
  */
 
 int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *a);
-int cx18_g_ctrl(struct file *file, void *fh, struct 

[linuxtv-commits] [hg:v4l-dvb] cx18: Improve Raptor card audio input routing defintions

2008-06-27 Thread Patch from Andy Walls
The patch number 8114 was added via Andy Walls [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Andy Walls  [EMAIL PROTECTED]
cx18: Improve Raptor card audio input routing defintions



cx18: Improved Raptor card audio input routing defintions, so that muxer values
matched cx18_gpio() values for tuner, line in 1, and radio and added LED
indication of selected audio input.  Audio line in 2 doesn't work as it uses
the not yet supported 2nd I2S port.  Tuner/FM Radio AF is mono until SIF
support is fixed.

Signed-off-by: Andy Walls [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-cards.c |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff -r 49ea64868f0c -r 30c4e5f561e2 linux/drivers/media/video/cx18/cx18-cards.c
--- a/linux/drivers/media/video/cx18/cx18-cards.c   Mon Jun 23 09:31:29 
2008 -0300
+++ b/linux/drivers/media/video/cx18/cx18-cards.c   Tue Jun 24 20:24:21 
2008 -0400
@@ -261,14 +261,14 @@ static const struct cx18_card cx18_card_
{ CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
},
.audio_inputs = {
-   { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 1 },
-   { CX18_CARD_INPUT_LINE_IN1,  CX18_AV_AUDIO_SERIAL, 0 },
-   { CX18_CARD_INPUT_LINE_IN2,  CX18_AV_AUDIO_SERIAL, 0 },
+   { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 0 },
+   { CX18_CARD_INPUT_LINE_IN1,  CX18_AV_AUDIO_SERIAL, 1 },
+   { CX18_CARD_INPUT_LINE_IN2,  CX18_AV_AUDIO_SERIAL, 1 },
},
.tuners = {
{ .std = V4L2_STD_PAL_SECAM, .tuner = 
TUNER_PHILIPS_FM1216ME_MK3 },
},
-   .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 0 },
+   .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 2 },
.ddr = {
/* MT 46V16M16 memory */
.chip_config = 0x50306,
@@ -278,9 +278,12 @@ static const struct cx18_card cx18_card_
.tune_lane = 0,
.initial_emrs = 0,
},
-   .gpio_init.initial_value = 0x02,
-   .gpio_init.direction = 0x02,
-   .gpio_audio_input  = { .mask = 0x02, .tuner  = 0x02, .linein = 0x00 },
+   .gpio_init.initial_value = 0x1002,
+   .gpio_init.direction = 0xf002,
+   .gpio_audio_input = { .mask   = 0xf002,
+ .tuner  = 0x1002,   /* LED D1  Tuner AF  */
+ .linein = 0x2000,   /* LED D2  Line In 1 */
+ .radio  = 0x4002 }, /* LED D3  Tuner AF  */
.pci_list = cx18_pci_cnxt_raptor_pal,
.i2c = cx18_i2c_std,
 };


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/30c4e5f561e28a696bf7bbd695d702656fc8cc18

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] Merge: from http://linuxtv.org/hg/~awalls/v4l-dvb

2008-06-27 Thread Patch from Hans Verkuil
The patch number 8115 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
Merge: from http://linuxtv.org/hg/~awalls/v4l-dvb




Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-cards.c |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff -r 248d809f4282 -r a948433cfcc4 linux/drivers/media/video/cx18/cx18-cards.c
--- a/linux/drivers/media/video/cx18/cx18-cards.c   Wed Jun 25 08:32:44 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-cards.c   Wed Jun 25 08:34:21 
2008 +0200
@@ -261,14 +261,14 @@ static const struct cx18_card cx18_card_
{ CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
},
.audio_inputs = {
-   { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 1 },
-   { CX18_CARD_INPUT_LINE_IN1,  CX18_AV_AUDIO_SERIAL, 0 },
-   { CX18_CARD_INPUT_LINE_IN2,  CX18_AV_AUDIO_SERIAL, 0 },
+   { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 0 },
+   { CX18_CARD_INPUT_LINE_IN1,  CX18_AV_AUDIO_SERIAL, 1 },
+   { CX18_CARD_INPUT_LINE_IN2,  CX18_AV_AUDIO_SERIAL, 1 },
},
.tuners = {
{ .std = V4L2_STD_PAL_SECAM, .tuner = 
TUNER_PHILIPS_FM1216ME_MK3 },
},
-   .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 0 },
+   .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL, 2 },
.ddr = {
/* MT 46V16M16 memory */
.chip_config = 0x50306,
@@ -278,9 +278,12 @@ static const struct cx18_card cx18_card_
.tune_lane = 0,
.initial_emrs = 0,
},
-   .gpio_init.initial_value = 0x02,
-   .gpio_init.direction = 0x02,
-   .gpio_audio_input  = { .mask = 0x02, .tuner  = 0x02, .linein = 0x00 },
+   .gpio_init.initial_value = 0x1002,
+   .gpio_init.direction = 0xf002,
+   .gpio_audio_input = { .mask   = 0xf002,
+ .tuner  = 0x1002,   /* LED D1  Tuner AF  */
+ .linein = 0x2000,   /* LED D2  Line In 1 */
+ .radio  = 0x4002 }, /* LED D3  Tuner AF  */
.pci_list = cx18_pci_cnxt_raptor_pal,
.i2c = cx18_i2c_std,
 };


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/a948433cfcc416ba96fe7c93ad37ff67d3a58329

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] videodev: allow PRIVATE_BASE controls when called through VIDIOC_G/S_CTRL.

2008-06-27 Thread Patch from Hans Verkuil
The patch number 8116 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
videodev: allow PRIVATE_BASE controls when called through VIDIOC_G/S_CTRL.


V4L2_CID_PRIVATE_BASE controls are not allowed when called from
VIDIOC_S/G_EXT_CTRL as extended controls use a better mechanism
for private controls. But still allow it when called from the
VIDIOC_G/S_CTRL to extended control conversion in video_ioctl2()
for backwards compatibility.


Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/videodev.c |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff -r a948433cfcc4 -r 69252caed40c linux/drivers/media/video/videodev.c
--- a/linux/drivers/media/video/videodev.c  Wed Jun 25 08:34:21 2008 +0200
+++ b/linux/drivers/media/video/videodev.c  Wed Jun 25 08:54:05 2008 +0200
@@ -748,7 +748,7 @@ static inline void v4l_print_ext_ctrls(u
printk(KERN_CONT \n);
 };
 
-static inline int check_ext_ctrls(struct v4l2_ext_controls *c)
+static inline int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv)
 {
__u32 i;
 
@@ -759,8 +759,11 @@ static inline int check_ext_ctrls(struct
c-controls[i].reserved2[1] = 0;
}
/* V4L2_CID_PRIVATE_BASE cannot be used as control class
-* when using extended controls. */
-   if (c-ctrl_class == V4L2_CID_PRIVATE_BASE)
+  when using extended controls.
+  Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL
+  is it allowed for backwards compatibility.
+*/
+   if (!allow_priv  c-ctrl_class == V4L2_CID_PRIVATE_BASE)
return 0;
/* Check that all controls are from the same control class. */
for (i = 0; i  c-count; i++) {
@@ -1464,7 +1467,7 @@ static int __video_do_ioctl(struct inode
ctrls.controls = ctrl;
ctrl.id = p-id;
ctrl.value = p-value;
-   if (check_ext_ctrls(ctrls)) {
+   if (check_ext_ctrls(ctrls, 1)) {
ret = vfd-vidioc_g_ext_ctrls(file, fh, ctrls);
if (ret == 0)
p-value = ctrl.value;
@@ -1500,7 +1503,7 @@ static int __video_do_ioctl(struct inode
ctrls.controls = ctrl;
ctrl.id = p-id;
ctrl.value = p-value;
-   if (check_ext_ctrls(ctrls))
+   if (check_ext_ctrls(ctrls, 1))
ret = vfd-vidioc_s_ext_ctrls(file, fh, ctrls);
break;
}
@@ -1511,7 +1514,7 @@ static int __video_do_ioctl(struct inode
p-error_idx = p-count;
if (!vfd-vidioc_g_ext_ctrls)
break;
-   if (check_ext_ctrls(p))
+   if (check_ext_ctrls(p, 0))
ret = vfd-vidioc_g_ext_ctrls(file, fh, p);
v4l_print_ext_ctrls(cmd, vfd, p, !ret);
break;
@@ -1524,7 +1527,7 @@ static int __video_do_ioctl(struct inode
if (!vfd-vidioc_s_ext_ctrls)
break;
v4l_print_ext_ctrls(cmd, vfd, p, 1);
-   if (check_ext_ctrls(p))
+   if (check_ext_ctrls(p, 0))
ret = vfd-vidioc_s_ext_ctrls(file, fh, p);
break;
}
@@ -1536,7 +1539,7 @@ static int __video_do_ioctl(struct inode
if (!vfd-vidioc_try_ext_ctrls)
break;
v4l_print_ext_ctrls(cmd, vfd, p, 1);
-   if (check_ext_ctrls(p))
+   if (check_ext_ctrls(p, 0))
ret = vfd-vidioc_try_ext_ctrls(file, fh, p);
break;
}


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/69252caed40c8521c039dcb02a75212dbf7ee9fe

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] saa7134: Avermedia A16D composite input

2008-06-27 Thread Patch from Dan Taylor
The patch number 8117 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Dan Taylor  [EMAIL PROTECTED]
saa7134: Avermedia A16D composite input


Signed-off-by: Star Trac by Unisen, Inc. Dan Taylor [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/drivers/media/video/saa7134/saa7134-cards.c |8 
 1 file changed, 8 insertions(+)

diff -r 69252caed40c -r 70346dc67b5e 
linux/drivers/media/video/saa7134/saa7134-cards.c
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c Wed Jun 25 08:54:05 
2008 +0200
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c Fri Jun 27 10:29:41 
2008 -0300
@@ -4246,6 +4246,10 @@ struct saa7134_board saa7134_boards[] = 
 .name = name_svideo,
 .vmux = 8,
 .amux = LINE1,
+   }, {
+   .name = name_comp,
+   .vmux = 0,
+   .amux = LINE1,
 } },
 .radio = {
 .name = name_radio,
@@ -4268,6 +4272,10 @@ struct saa7134_board saa7134_boards[] = 
}, {
.name = name_svideo,
.vmux = 8,
+   .amux = LINE1,
+   }, {
+   .name = name_comp,
+   .vmux = 0,
.amux = LINE1,
} },
.radio = {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/70346dc67b5e2e45136400450489c6b1791fc7e3

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] Improves commit message scripts

2008-06-27 Thread Patch from Mauro Carvalho Chehab
The patch number 8119 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Improves commit message scripts


This patch improves message description sanity rules:

- mailimport now prefers to edit using editdiff. This helps to fix
  trivial CodingStyle errors at receive patches;

- hghead.pl will now remove blank whitespaces if no body exists;

- make commit will now run hghead.pl. This will do some sanity checks
  at commit messages:
  *) Will warrant that from: metatag exists, avoiding to have patches without
 proper authorship id at someone's else tree;

  *) Will order the tags at the expected way (subject, from, body, signatures);

  *) Will warrant that one and just one blank line exists between each of the 
four
 parts of the commit message.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 Makefile  |2 +-
 mailimport|   20 
 v4l/scripts/hghead.pl |3 +++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff -r 13319e163b80 -r 052e17686177 Makefile
--- a/Makefile  Fri Jun 27 10:30:04 2008 -0300
+++ b/Makefile  Fri Jun 27 11:19:39 2008 -0300
@@ -27,7 +27,7 @@ commit cvscommit hgcommit change changes
echo $$CHECKSUM | md5sum -c --status  \
echo *** commit message not changed. Aborting. *** \
 exit 13 || exit 0
-   grep -v '^#' $(TMP)/v4l_hg_commit.msg | hg commit -l -
+   $(BUILD_DIR)/scripts/hghead.pl $(TMP)/v4l_hg_commit.msg | grep -v '^#' 
| hg commit -l -
@echo *** PLEASE CHECK IF LOG IS OK:
@hg log -v -r -1
@echo *** If not ok, do \hg rollback\ and \make commit\ again
diff -r 13319e163b80 -r 052e17686177 mailimport
--- a/mailimportFri Jun 27 10:30:04 2008 -0300
+++ b/mailimportFri Jun 27 11:19:39 2008 -0300
@@ -34,7 +34,7 @@ edit_patch()
mv $tmp/$newfile $next;
fi
echo Editing $next
-   $EDITOR $next
+   $ED $next
 }
 
 
@@ -80,7 +80,7 @@ apply_patch () {
if [ `grep '^Bad:' $TMP2` !=  ]; then
echo *** ERROR: Patch bad formed. Please fix.
sleep 1
-   $EDITOR $next
+   $ED $next
cont=1
fi
done
@@ -214,8 +214,20 @@ if [ $TMPDIR ==  ]; then
TMPDIR=/tmp
 fi
 
-if [ $EDITOR ==  ]; then
-   EDITOR=nano -w
+if [ `which editdiff`  !=  ]; then
+   ED=editdiff
+else
+   ED=$EDITOR
+fi
+
+if [ $ED ==  ]; then
+   if [ `which nano` !=  ]; then
+   ED=nano -w
+   elif [ `which pico` !=  ]; then
+   ED=pico -w
+   else
+   ED=vi
+   fi
 fi
 
 if [ $CHECKPATCH ==  ]; then
diff -r 13319e163b80 -r 052e17686177 v4l/scripts/hghead.pl
--- a/v4l/scripts/hghead.pl Fri Jun 27 10:30:04 2008 -0300
+++ b/v4l/scripts/hghead.pl Fri Jun 27 11:19:39 2008 -0300
@@ -188,6 +188,9 @@ if (!$signed =~ m/$from/) {
 $subject=~s/^[\n\s]+//;
 $subject=~s/[\n\s]+$//;
 
+$body=~s/^[\n\s]+//;
+$body=~s/[\n\s]+$//;
+
 $body=$body\n\n$signed;
 
 $body=~s/^[\n\s]+//;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/052e17686177e2861351c35c6865a17f223c77cf

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits