V4L/DVB (11538): gscpa - m5602-ov9650: Add defines for some magic constants
authorErik Andr?n <erik.andren@gmail.com>
Sun, 18 Jan 2009 18:21:07 +0000 (15:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 21:20:34 +0000 (18:20 -0300)
Replaces some magic constants with the defines. Remove a couple of bits that should be set later in the process depending on the v4l2 ctrl.

Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/m5602/m5602_ov9650.h

index e0ba418..27fe542 100644 (file)
 #define OV9650_SOFT_SLEEP              (1 << 4)
 #define OV9650_OUTPUT_DRIVE_2X         (1 << 0)
 
+#define OV9650_DENOISE_ENABLE          (1 << 5)
+#define OV9650_WHITE_PIXEL_ENABLE      (1 << 1)
+#define OV9650_WHITE_PIXEL_OPTION      (1 << 0)
+
 #define OV9650_LEFT_OFFSET             0x62
 
 #define GAIN_DEFAULT                   0x14
@@ -198,7 +202,7 @@ static const unsigned char init_ov9650[][3] =
        /* Reset chip */
        {SENSOR, OV9650_COM7, OV9650_REGISTER_RESET},
        /* One extra reset is needed in order to make the sensor behave
-          properly when resuming from ram */
+          properly when resuming from ram, could be a timing issue */
        {SENSOR, OV9650_COM7, OV9650_REGISTER_RESET},
 
        /* Enable double clock */
@@ -208,8 +212,7 @@ static const unsigned char init_ov9650[][3] =
 
        /* Set fast AGC/AEC algorithm with unlimited step size */
        {SENSOR, OV9650_COM8, OV9650_FAST_AGC_AEC |
-                             OV9650_AEC_UNLIM_STEP_SIZE |
-                             OV9650_AWB_EN | OV9650_AGC_EN},
+                             OV9650_AEC_UNLIM_STEP_SIZE},
 
        {SENSOR, OV9650_CHLF, 0x10},
        {SENSOR, OV9650_ARBLM, 0xbf},
@@ -280,8 +283,11 @@ static const unsigned char init_ov9650[][3] =
        {SENSOR, OV9650_VREF, 0x10},
        {SENSOR, OV9650_ADC, 0x04},
        {SENSOR, OV9650_HV, 0x40},
+
        /* Enable denoise, and white-pixel erase */
-       {SENSOR, OV9650_COM22, 0x23},
+       {SENSOR, OV9650_COM22, OV9650_DENOISE_ENABLE |
+                OV9650_WHITE_PIXEL_ENABLE |
+                OV9650_WHITE_PIXEL_OPTION},
 
        /* Enable VARIOPIXEL */
        {SENSOR, OV9650_COM3, OV9650_VARIOPIXEL},