ov9650: Reading the COM1 register corrupts the image.
Decrease the granularity of the exposure and limit its upper range
as setting such high values doesn't have any effect on the image.
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
                        .type           = V4L2_CTRL_TYPE_INTEGER,
                        .name           = "exposure",
                        .minimum        = 0x00,
-                       .maximum        = 0xffff,
-                       .step           = 0x1,
+                       .maximum        = 0x1ff,
+                       .step           = 0x4,
                        .default_value  = EXPOSURE_DEFAULT,
                        .flags          = V4L2_CTRL_FLAG_SLIDER
                },
        u8 i2c_data;
        int err;
 
-       err = m5602_read_sensor(sd, OV9650_COM1, &i2c_data, 1);
-       if (err < 0)
-               return err;
-       *val = i2c_data & 0x03;
-
        err = m5602_read_sensor(sd, OV9650_AECH, &i2c_data, 1);
        if (err < 0)
                return err;
 
 #define GAIN_DEFAULT                   0x14
 #define RED_GAIN_DEFAULT               0x70
 #define BLUE_GAIN_DEFAULT              0x20
-#define EXPOSURE_DEFAULT               0x5003
+#define EXPOSURE_DEFAULT               0x1ff
 
 /*****************************************************************************/