aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/ov534.c
diff options
context:
space:
mode:
authorMax Thrun <bear24rw@gmail.com>2010-02-27 15:20:23 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:46:57 -0400
commit8fef9d962237e29b3d84243387b1f3487b3caaf4 (patch)
tree7a0c06abae5216144d3db84044d9beeea900116a /drivers/media/video/gspca/ov534.c
parent18cf8c91ad558f8d2d0177656df493f81949cfe6 (diff)
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/media/video/gspca/ov534.c')
-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 4fda0980be04..3b538d735ecc 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[] = {
171 .minimum = 0, 171 .minimum = 0,
172 .maximum = 1, 172 .maximum = 1,
173 .step = 1, 173 .step = 1,
174#define AWB_DEF 0 174#define AWB_DEF 1
175 .default_value = AWB_DEF, 175 .default_value = AWB_DEF,
176 }, 176 },
177 .set = sd_setawb, 177 .set = sd_setawb,
@@ -723,10 +723,17 @@ static void setawb(struct gspca_dev *gspca_dev)
723{ 723{
724 struct sd *sd = (struct sd *) gspca_dev; 724 struct sd *sd = (struct sd *) gspca_dev;
725 725
726 if (sd->awb) 726 if (sd->awb) {
727 sccb_reg_write(gspca_dev, 0x63, 0xe0); /* AWB on */ 727 sccb_reg_write(gspca_dev, 0x13,
728 else 728 sccb_reg_read(gspca_dev, 0x13) | 0x02);
729 sccb_reg_write(gspca_dev, 0x63, 0xaa); /* AWB off */ 729 sccb_reg_write(gspca_dev, 0x63,
730 sccb_reg_read(gspca_dev, 0x63) | 0xc0);
731 } else {
732 sccb_reg_write(gspca_dev, 0x13,
733 sccb_reg_read(gspca_dev, 0x13) & ~0x02);
734 sccb_reg_write(gspca_dev, 0x63,
735 sccb_reg_read(gspca_dev, 0x63) & ~0xc0);
736 }
730} 737}
731 738
732static void setaec(struct gspca_dev *gspca_dev) 739static void setaec(struct gspca_dev *gspca_dev)
@@ -805,9 +812,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
805#else 812#else
806 gspca_dev->ctrl_inac |= (1 << AWB_IDX); 813 gspca_dev->ctrl_inac |= (1 << AWB_IDX);
807#endif 814#endif
808#if AWB_DEF != 0 815 sd->awb = AWB_DEF;
809 sd->awb = AWB_DEF
810#endif
811 sd->aec = AEC_DEF; 816 sd->aec = AEC_DEF;
812#if SHARPNESS_DEF != 0 817#if SHARPNESS_DEF != 0
813 sd->sharpness = SHARPNESS_DEF; 818 sd->sharpness = SHARPNESS_DEF;