V4L/DVB (10430): gspca - sonixj: Adjust some exchanges with the sensor mt9v111.
authorJean-Francois Moine <moinejf@free.fr>
Sun, 1 Feb 2009 17:48:55 +0000 (14:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:37 +0000 (12:42 -0300)
This patch also enables the autogain for the mt9v111.

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

index 4101a240e4810613c47179277ad7f2370e874d50..970c74f9fe8b61ac52d0e5d54339b6bc85a54bb4 100644 (file)
@@ -234,7 +234,7 @@ static __u32 ctrl_dis[] = {
                                                /* SENSOR_MI0360 1 */
        (1 << INFRARED_IDX) | (1 << VFLIP_IDX),
                                                /* SENSOR_MO4000 2 */
-       (1 << AUTOGAIN_IDX),
+       0,
                                                /* SENSOR_MT9V111 3 */
        (1 << INFRARED_IDX) | (1 << VFLIP_IDX),
                                                /* SENSOR_OM6802 4 */
@@ -517,8 +517,18 @@ static const u8 mt9v111_sensor_init[][8] = {
        {0xb1, 0x5c, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10}, /* IFP select */
        {0xb1, 0x5c, 0x08, 0x04, 0x80, 0x00, 0x00, 0x10}, /* output fmt ctrl */
        {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}, /* op mode ctrl */
+       {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x03, 0x01, 0xe1, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x04, 0x02, 0x81, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x05, 0x00, 0x04, 0x00, 0x00, 0x10},
        {0xb1, 0x5c, 0x01, 0x00, 0x04, 0x00, 0x00, 0x10}, /* sensor select */
+       {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x03, 0x01, 0xe6, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x04, 0x02, 0x86, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x05, 0x00, 0x04, 0x00, 0x00, 0x10},
+       {0xb1, 0x5c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10},
        {0xb1, 0x5c, 0x08, 0x00, 0x08, 0x00, 0x00, 0x10}, /* row start */
+       {0xb1, 0x5c, 0x0e, 0x00, 0x08, 0x00, 0x00, 0x10},
        {0xb1, 0x5c, 0x02, 0x00, 0x16, 0x00, 0x00, 0x10}, /* col start */
        {0xb1, 0x5c, 0x03, 0x01, 0xe7, 0x00, 0x00, 0x10}, /* window height */
        {0xb1, 0x5c, 0x04, 0x02, 0x87, 0x00, 0x00, 0x10}, /* window width */
@@ -532,7 +542,7 @@ static const u8 mt9v111_sensor_init[][8] = {
        /*******/
        {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
        {0xb1, 0x5c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10},
-       {0xb1, 0x5c, 0x09, 0x00, 0x64, 0x00, 0x00, 0x10}, /* shutter width */
+       {0xb1, 0x5c, 0x09, 0x01, 0x2c, 0x00, 0x00, 0x10},
        {0xd1, 0x5c, 0x2b, 0x00, 0x33, 0x00, 0xa0, 0x10}, /* green1 gain */
        {0xd1, 0x5c, 0x2d, 0x00, 0xa0, 0x00, 0x33, 0x10}, /* red gain */
        /*******/
@@ -1688,7 +1698,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
                        reg1 = 0x04;    /* 320 clk 48Mhz */
                } else {
 /*                     reg1 = 0x06;     * 640 clk 24Mz (done) */
-                       reg17 = 0xe2;
+                       reg17 = 0xc2;
                }
                break;
        case SENSOR_OM6802: