[media] gspca - sn9c20x: Don't do sensor update before the capture is started
authorJean-François Moine <moinejf@free.fr>
Sat, 24 Mar 2012 12:28:39 +0000 (09:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 3 May 2012 18:29:56 +0000 (15:29 -0300)
Telling the bridge to update the sensor when setting the exposure or the gain
is not needed when the image transfer is not started.

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

index c5b42e4ac9b48e670c59a37f2ee636363fb1d71c..da2904a891aa78ed07faaab4da60bd0cbea59e5c 100644 (file)
@@ -1644,9 +1644,12 @@ static void set_exposure(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
        u8 exp[8] = {sd->i2c_intf, sd->i2c_addr,
-                               0x00, 0x00, 0x00, 0x00, 0x00, 0x1e};
+                               0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
        int expo;
 
+       if (gspca_dev->streaming)
+               exp[7] = 0x1e;
+
        expo = sd->ctrls[EXPOSURE].val;
        switch (sd->sensor) {
        case SENSOR_OV7660:
@@ -1683,9 +1686,12 @@ static void set_gain(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
        u8 gain[8] = {sd->i2c_intf, sd->i2c_addr,
-                               0x00, 0x00, 0x00, 0x00, 0x00, 0x1d};
+                               0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
        int g;
 
+       if (gspca_dev->streaming)
+               gain[7] = 0x15;         /* or 1d ? */
+
        g = sd->ctrls[GAIN].val;
        switch (sd->sensor) {
        case SENSOR_OV7660: