diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-11-12 16:59:48 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 10:16:43 (GMT) |
commit | e2817029b3f139bd85360536153467bd8f7f863b (patch) | |
tree | 4b76386ded973333a9d323ea43a3b8defd787f49 /drivers | |
parent | 858ea5e941fad6a2f38d0c9722bbb842d46662fb (diff) | |
download | linux-fsl-qoriq-e2817029b3f139bd85360536153467bd8f7f863b.tar.xz |
[media] gspca - ov519: Check the disabled controls at start time only
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/ov519.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 7ae304d..d603220 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c @@ -3667,8 +3667,6 @@ static void sethvflip(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; - if (sd->sensor != SEN_OV7670) - return; if (sd->gspca_dev.streaming) ov51x_stop(sd); i2c_w_mask(sd, OV7670_R1E_MVFP, @@ -3812,12 +3810,18 @@ static int sd_start(struct gspca_dev *gspca_dev) set_ov_sensor_window(sd); - setcontrast(gspca_dev); - setbrightness(gspca_dev); - setcolors(gspca_dev); - sethvflip(gspca_dev); - setautobright(gspca_dev); - setfreq_i(sd); + if (!(sd->gspca_dev.ctrl_dis & (1 << CONTRAST))) + setcontrast(gspca_dev); + if (!(sd->gspca_dev.ctrl_dis & (1 << BRIGHTNESS))) + setbrightness(gspca_dev); + if (!(sd->gspca_dev.ctrl_dis & (1 << COLORS))) + setcolors(gspca_dev); + if (!(sd->gspca_dev.ctrl_dis & ((1 << HFLIP) | (1 << VFLIP)))) + sethvflip(gspca_dev); + if (!(sd->gspca_dev.ctrl_dis & (1 << AUTOBRIGHT))) + setautobright(gspca_dev); + if (!(sd->gspca_dev.ctrl_dis & (1 << FREQ))) + setfreq_i(sd); /* Force clear snapshot state in case the snapshot button was pressed while we weren't streaming */ @@ -4184,19 +4188,11 @@ static void setautobright(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; - if (sd->sensor == SEN_OV7640 || sd->sensor == SEN_OV7648 || - sd->sensor == SEN_OV7670 || - sd->sensor == SEN_OV2610 || sd->sensor == SEN_OV3610) - return; - i2c_w_mask(sd, 0x2d, sd->ctrls[AUTOBRIGHT].val ? 0x10 : 0x00, 0x10); } static void setfreq_i(struct sd *sd) { - if (sd->sensor == SEN_OV2610 || sd->sensor == SEN_OV3610) - return; - if (sd->sensor == SEN_OV7670) { switch (sd->ctrls[FREQ].val) { case 0: /* Banding filter disabled */ |