The patch number 13245 was added via h...@rhel5-devel.localdomain
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: Theodore Kilgore  <kilg...@banach.math.auburn.edu>
gspca_mr97310a: Change blue gain setting for Sakar Digital VGA camera


gspca_mr97310a: Change blue gain setting for Sakar Digital VGA camera

Priority: normal

Signed-off-by: Theodore Kilgore <kilg...@banach.math.auburn.edu>
Signed-off-by: Hans de Goede <hdego...@redhat.com>


---

 linux/drivers/media/video/gspca/mr97310a.c |   32 +++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff -r ef36dd899ed1 -r 428e691e356b linux/drivers/media/video/gspca/mr97310a.c
--- a/linux/drivers/media/video/gspca/mr97310a.c        Fri Oct 30 08:29:56 
2009 +0100
+++ b/linux/drivers/media/video/gspca/mr97310a.c        Fri Oct 30 08:43:39 
2009 +0100
@@ -78,6 +78,7 @@
        u8 cam_type;    /* 0 is CIF and 1 is VGA */
        u8 sensor_type; /* We use 0 and 1 here, too. */
        u8 do_lcd_stop;
+       u8 adj_colors;
 
        int brightness;
        u16 exposure;
@@ -525,6 +526,7 @@
 
                sd->sensor_type = 1;
                sd->do_lcd_stop = 0;
+               sd->adj_colors = 0;
                if ((gspca_dev->usb_buf[0] != 0x03) &&
                                        (gspca_dev->usb_buf[0] != 0x04)) {
                        PDEBUG(D_ERR, "Unknown VGA Sensor id Byte 0: %02x",
@@ -532,6 +534,10 @@
                        PDEBUG(D_ERR, "Defaults assumed, may not work");
                        PDEBUG(D_ERR, "Please report this");
                }
+               /* Sakar Digital color needs to be adjusted. */
+               if ((gspca_dev->usb_buf[0] == 0x03) &&
+                                       (gspca_dev->usb_buf[1] == 0x50))
+                       sd->adj_colors = 1;
                if (gspca_dev->usb_buf[0] == 0x04) {
                        sd->do_lcd_stop = 1;
                        switch (gspca_dev->usb_buf[1]) {
@@ -759,9 +765,20 @@
                err_code = sensor_write_regs(gspca_dev, vga_sensor0_init_data,
                                         ARRAY_SIZE(vga_sensor0_init_data));
        } else {        /* sd->sensor_type = 1 */
+               const struct sensor_w_data color_adj[] = {
+                       {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00,
+                               /* adjusted blue, green, red gain correct
+                                  too much blue from the Sakar Digital */
+                               0x05, 0x01, 0x05}, 8}
+               };
+
+               const struct sensor_w_data color_no_adj[] = {
+                       {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00,
+                               /* default blue, green, red gain settings */
+                               0x07, 0x00, 0x01}, 8}
+               };
+
                const struct sensor_w_data vga_sensor1_init_data[] = {
-                       {0x02, 0x00, {0x06, 0x59, 0x0c, 0x16, 0x00,
-                               0x07, 0x00, 0x01}, 8},
                        {0x11, 0x04, {0x01}, 1},
                        /*{0x0a, 0x00, {0x00, 0x01, 0x00, 0x00, 0x01, */
                        {0x0a, 0x00, {0x01, 0x06, 0x00, 0x00, 0x01,
@@ -771,6 +788,17 @@
                        {0x11, 0x04, {0x01}, 1},
                        {0, 0, {0}, 0}
                };
+
+               if (sd->adj_colors)
+                       err_code = sensor_write_regs(gspca_dev, color_adj,
+                                        ARRAY_SIZE(color_adj));
+               else
+                       err_code = sensor_write_regs(gspca_dev, color_no_adj,
+                                        ARRAY_SIZE(color_no_adj));
+
+               if (err_code < 0)
+                       return err_code;
+
                err_code = sensor_write_regs(gspca_dev, vga_sensor1_init_data,
                                         ARRAY_SIZE(vga_sensor1_init_data));
        }


---

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

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

Reply via email to