Commit cf3c1c31 authored by Antonio Ospite's avatar Antonio Ospite Committed by Mauro Carvalho Chehab

[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: default avatarAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bc378fee
...@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev); ...@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev);
static void setcontrast(struct gspca_dev *gspca_dev); static void setcontrast(struct gspca_dev *gspca_dev);
static void setgain(struct gspca_dev *gspca_dev); static void setgain(struct gspca_dev *gspca_dev);
static void setexposure(struct gspca_dev *gspca_dev); static void setexposure(struct gspca_dev *gspca_dev);
static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val); static void setagc(struct gspca_dev *gspca_dev);
static void setawb(struct gspca_dev *gspca_dev); static void setawb(struct gspca_dev *gspca_dev);
static void setaec(struct gspca_dev *gspca_dev); static void setaec(struct gspca_dev *gspca_dev);
static void setsharpness(struct gspca_dev *gspca_dev); static void setsharpness(struct gspca_dev *gspca_dev);
...@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = { ...@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = {
.step = 1, .step = 1,
.default_value = 1, .default_value = 1,
}, },
.set = sd_setagc .set_control = setagc
}, },
[AWB] = { [AWB] = {
{ {
...@@ -1242,10 +1242,6 @@ static int sd_config(struct gspca_dev *gspca_dev, ...@@ -1242,10 +1242,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam->ctrls = sd->ctrls; cam->ctrls = sd->ctrls;
/* the auto white balance control works only when auto gain is set */
if (sd_ctrls[AGC].qctrl.default_value == 0)
gspca_dev->ctrl_inac |= (1 << AWB);
cam->cam_mode = ov772x_mode; cam->cam_mode = ov772x_mode;
cam->nmodes = ARRAY_SIZE(ov772x_mode); cam->nmodes = ARRAY_SIZE(ov772x_mode);
...@@ -1486,29 +1482,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -1486,29 +1482,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
} while (remaining_len > 0); } while (remaining_len > 0);
} }
static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val)
{
struct sd *sd = (struct sd *) gspca_dev;
sd->ctrls[AGC].val = val;
/* the auto white balance control works only
* when auto gain is set */
if (val) {
gspca_dev->ctrl_inac &= ~(1 << AWB);
} else {
gspca_dev->ctrl_inac |= (1 << AWB);
if (sd->ctrls[AWB].val) {
sd->ctrls[AWB].val = 0;
if (gspca_dev->streaming)
setawb(gspca_dev);
}
}
if (gspca_dev->streaming)
setagc(gspca_dev);
return gspca_dev->usb_err;
}
static int sd_querymenu(struct gspca_dev *gspca_dev, static int sd_querymenu(struct gspca_dev *gspca_dev,
struct v4l2_querymenu *menu) struct v4l2_querymenu *menu)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment