aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorAntonio Ospite <ospite@studenti.unina.it>2012-05-16 17:42:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-11 15:06:15 -0400
commitcf3c1c319500e879daa1487f41bb094bd377566f (patch)
tree46721f4f4fa954db031b37cc5e253e9419422a92 /drivers/media/video/gspca
parentbc378feeda46633cfa92dac7a7ef5df66047b0ef (diff)
[media] gspca_ov534: make AGC and AWB controls independent
Even if the best results are indeed achieved with both AGC and AWB enabled, the webcam is capable of setting these independently, and the user can see the difference of any of the 4 combinations of these two boolean controls. Removing the dependency from one another simplifies the code and gives more control to the user. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/ov534.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c
index b5acb1e4b4e7..c16bd1b7914a 100644
--- a/drivers/media/video/gspca/ov534.c
+++ b/drivers/media/video/gspca/ov534.c
@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev);
96static void setcontrast(struct gspca_dev *gspca_dev); 96static void setcontrast(struct gspca_dev *gspca_dev);
97static void setgain(struct gspca_dev *gspca_dev); 97static void setgain(struct gspca_dev *gspca_dev);
98static void setexposure(struct gspca_dev *gspca_dev); 98static void setexposure(struct gspca_dev *gspca_dev);
99static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val); 99static void setagc(struct gspca_dev *gspca_dev);
100static void setawb(struct gspca_dev *gspca_dev); 100static void setawb(struct gspca_dev *gspca_dev);
101static void setaec(struct gspca_dev *gspca_dev); 101static void setaec(struct gspca_dev *gspca_dev);
102static void setsharpness(struct gspca_dev *gspca_dev); 102static void setsharpness(struct gspca_dev *gspca_dev);
@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = {
189 .step = 1, 189 .step = 1,
190 .default_value = 1, 190 .default_value = 1,
191 }, 191 },
192 .set = sd_setagc 192 .set_control = setagc
193 }, 193 },
194[AWB] = { 194[AWB] = {
195 { 195 {
@@ -1242,10 +1242,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
1242 1242
1243 cam->ctrls = sd->ctrls; 1243 cam->ctrls = sd->ctrls;
1244 1244
1245 /* the auto white balance control works only when auto gain is set */
1246 if (sd_ctrls[AGC].qctrl.default_value == 0)
1247 gspca_dev->ctrl_inac |= (1 << AWB);
1248
1249 cam->cam_mode = ov772x_mode; 1245 cam->cam_mode = ov772x_mode;
1250 cam->nmodes = ARRAY_SIZE(ov772x_mode); 1246 cam->nmodes = ARRAY_SIZE(ov772x_mode);
1251 1247
@@ -1486,29 +1482,6 @@ scan_next:
1486 } while (remaining_len > 0); 1482 } while (remaining_len > 0);
1487} 1483}
1488 1484
1489static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val)
1490{
1491 struct sd *sd = (struct sd *) gspca_dev;
1492
1493 sd->ctrls[AGC].val = val;
1494
1495 /* the auto white balance control works only
1496 * when auto gain is set */
1497 if (val) {
1498 gspca_dev->ctrl_inac &= ~(1 << AWB);
1499 } else {
1500 gspca_dev->ctrl_inac |= (1 << AWB);
1501 if (sd->ctrls[AWB].val) {
1502 sd->ctrls[AWB].val = 0;
1503 if (gspca_dev->streaming)
1504 setawb(gspca_dev);
1505 }
1506 }
1507 if (gspca_dev->streaming)
1508 setagc(gspca_dev);
1509 return gspca_dev->usb_err;
1510}
1511
1512static int sd_querymenu(struct gspca_dev *gspca_dev, 1485static int sd_querymenu(struct gspca_dev *gspca_dev,
1513 struct v4l2_querymenu *menu) 1486 struct v4l2_querymenu *menu)
1514{ 1487{