The patch number 14375 was added via Douglas Schilling Landgraf 
<dougsl...@redhat.com>
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:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Hans de Goede  <hdego...@redhat.com>
gspca_sonixb: leave bridge gain at 1.0 when we have a sensor gain


Leave bridge gain at 1.0 when we have a sensor gain, while at it also
change the bridge gain setting code to write both registers in one go
saving us a usb transaction.

Priority: normal

Signed-off-by: Hans de Goede <hdego...@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>
Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>


---

 linux/drivers/media/video/gspca/sonixb.c |   26 ++++++++++++-----------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff -r 01eac6dcca12 -r 33e3981a62fc linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Mar 04 00:09:08 2010 -0300
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Mar 04 00:12:16 2010 -0300
@@ -377,7 +377,7 @@
 };
 static const __u8 initOv7630_3[] = {
        0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */
-       0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */
+       0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */
        0x00, 0x02, 0x01, 0x0a,                         /* r11 .. r14 */
        0x28, 0x1e,                     /* H & V sizes     r15 .. r16 */
        0x68, 0x8f, MCK_INIT1,                          /* r17 .. r19 */
@@ -495,7 +495,7 @@
 static const __u8 initTas5110c[] = {
        0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00,
        0x00, 0x00,
-       0x00, 0x01, 0x00, 0x45, 0x09, 0x0a,
+       0x00, 0x00, 0x00, 0x45, 0x09, 0x0a,
        0x16, 0x12, 0x60, 0x86, 0x2b,
        0x14, 0x0a, 0x02, 0x02, 0x09, 0x07
 };
@@ -503,7 +503,7 @@
 static const __u8 initTas5110d[] = {
        0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00,
        0x00, 0x00,
-       0x00, 0x01, 0x00, 0x41, 0x09, 0x0a,
+       0x00, 0x00, 0x00, 0x41, 0x09, 0x0a,
        0x16, 0x12, 0x60, 0x86, 0x2b,
        0x14, 0x0a, 0x02, 0x02, 0x09, 0x07
 };
@@ -516,7 +516,7 @@
 static const __u8 initTas5130[] = {
        0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00,
        0x00, 0x00,
-       0x00, 0x01, 0x00, 0x68, 0x0c, 0x0a,
+       0x00, 0x00, 0x00, 0x68, 0x0c, 0x0a,
        0x28, 0x1e, 0x60, COMP, MCK_INIT,
        0x18, 0x10, 0x04, 0x03, 0x11, 0x0c
 };
@@ -727,19 +727,21 @@
 {
        struct sd *sd = (struct sd *) gspca_dev;
        __u8 gain;
-       __u8 rgb_value;
+       __u8 buf[2] = { 0, 0 };
+
+       if (sensor_data[sd->sensor].flags & F_GAIN) {
+               /* Use the sensor gain to do the actual gain */
+               setsensorgain(gspca_dev);
+               return;
+       }
 
        gain = sd->gain >> 4;
 
        /* red and blue gain */
-       rgb_value = gain << 4 | gain;
-       reg_w(gspca_dev, 0x10, &rgb_value, 1);
+       buf[0] = gain << 4 | gain;
        /* green gain */
-       rgb_value = gain;
-       reg_w(gspca_dev, 0x11, &rgb_value, 1);
-
-       if (sensor_data[sd->sensor].flags & F_GAIN)
-               setsensorgain(gspca_dev);
+       buf[1] = gain;
+       reg_w(gspca_dev, 0x10, buf, 2);
 }
 
 static void setexposure(struct gspca_dev *gspca_dev)


---

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

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

Reply via email to