[media] gspca - sonixj: Change color control for sensor po2030n
authorJean-François Moine <moinejf@free.fr>
Wed, 30 Nov 2011 09:20:07 +0000 (06:20 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 11 Dec 2011 11:26:46 +0000 (09:26 -0200)
Adjustment of the colors by the po2030n is finer than by the bridge controls.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/sonixj.c

index a87b1e1..c55d667 100644 (file)
@@ -1235,7 +1235,7 @@ static const u8 po2030n_sensor_param1[][8] = {
        {DELAY, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* delay 8ms */
        {0xa1, 0x6e, 0x1b, 0xf4, 0x00, 0x00, 0x00, 0x10},
        {0xa1, 0x6e, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10},
-       {0xd1, 0x6e, 0x16, 0x50, 0x40, 0x49, 0x40, 0x10},
+       {0xd1, 0x6e, 0x16, 0x40, 0x40, 0x40, 0x40, 0x10}, /* RGBG gains */
 /*param2*/
        {0xa1, 0x6e, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x10},
        {0xa1, 0x6e, 0x04, 0x03, 0x00, 0x00, 0x00, 0x10},
@@ -2059,6 +2059,16 @@ static void setredblue(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
+       if (sd->sensor == SENSOR_PO2030N) {
+               u8 rg1b[] =             /* red  green1 blue (no g2) */
+                       {0xc1, 0x6e, 0x16, 0x00, 0x40, 0x00, 0x00, 0x10};
+
+               /* 0x40 = normal value = gain x 1 */
+               rg1b[3] = sd->ctrls[RED].val * 2;
+               rg1b[5] = sd->ctrls[BLUE].val * 2;
+               i2c_w8(gspca_dev, rg1b);
+               return;
+       }
        reg_w1(gspca_dev, 0x05, sd->ctrls[RED].val);
 /*     reg_w1(gspca_dev, 0x07, 32); */
        reg_w1(gspca_dev, 0x06, sd->ctrls[BLUE].val);