summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMax Thrun <bear24rw@gmail.com>2010-02-27 20:20:23 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-18 03:46:57 (GMT)
commit8fef9d962237e29b3d84243387b1f3487b3caaf4 (patch)
tree7a0c06abae5216144d3db84044d9beeea900116a /drivers
parent18cf8c91ad558f8d2d0177656df493f81949cfe6 (diff)
downloadlinux-fsl-qoriq-8fef9d962237e29b3d84243387b1f3487b3caaf4.tar.xz
V4L/DVB: gspca - ov534: Fix Auto White Balance control
Set only the needed bits for AWB, and enable it by default. Signed-off-by: Max Thrun <bear24rw@gmail.com> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/ov534.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c
index 4fda098..3b538d7 100644
--- a/drivers/media/video/gspca/ov534.c
+++ b/drivers/media/video/gspca/ov534.c
@@ -171,7 +171,7 @@ static const struct ctrl sd_ctrls[] = {
.minimum = 0,
.maximum = 1,
.step = 1,
-#define AWB_DEF 0
+#define AWB_DEF 1
.default_value = AWB_DEF,
},
.set = sd_setawb,
@@ -723,10 +723,17 @@ static void setawb(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
- if (sd->awb)
- sccb_reg_write(gspca_dev, 0x63, 0xe0); /* AWB on */
- else
- sccb_reg_write(gspca_dev, 0x63, 0xaa); /* AWB off */
+ if (sd->awb) {
+ sccb_reg_write(gspca_dev, 0x13,
+ sccb_reg_read(gspca_dev, 0x13) | 0x02);
+ sccb_reg_write(gspca_dev, 0x63,
+ sccb_reg_read(gspca_dev, 0x63) | 0xc0);
+ } else {
+ sccb_reg_write(gspca_dev, 0x13,
+ sccb_reg_read(gspca_dev, 0x13) & ~0x02);
+ sccb_reg_write(gspca_dev, 0x63,
+ sccb_reg_read(gspca_dev, 0x63) & ~0xc0);
+ }
}
static void setaec(struct gspca_dev *gspca_dev)
@@ -805,9 +812,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
#else
gspca_dev->ctrl_inac |= (1 << AWB_IDX);
#endif
-#if AWB_DEF != 0
- sd->awb = AWB_DEF
-#endif
+ sd->awb = AWB_DEF;
sd->aec = AEC_DEF;
#if SHARPNESS_DEF != 0
sd->sharpness = SHARPNESS_DEF;