aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-03-13 15:05:55 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:54:46 -0400
commitf0baad866b3c71d448747b06b1cf6b3493d2f7ce (patch)
treeb95ef80c78794beeb9452850bafb5e3ec42a3769 /drivers/media/video/gspca
parentf51a8caafedfc643b3dfa2ffdfb02da31a13db3f (diff)
[media] gspca - sonixb: Update inactive flags to reflect autogain setting
Signed-off-by: Hans de Goede <hdegoede@redhat.com> 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')
-rw-r--r--drivers/media/video/gspca/sonixb.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 13cca7a82cb4..c6c65f2da351 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -209,7 +209,7 @@ static const struct ctrl sd_ctrls[NCTRLS] = {
209 .step = 1, 209 .step = 1,
210#define AUTOGAIN_DEF 1 210#define AUTOGAIN_DEF 1
211 .default_value = AUTOGAIN_DEF, 211 .default_value = AUTOGAIN_DEF,
212 .flags = 0, 212 .flags = V4L2_CTRL_FLAG_UPDATE
213 }, 213 },
214 .set = sd_setautogain, 214 .set = sd_setautogain,
215 }, 215 },
@@ -1008,7 +1008,8 @@ static void do_autogain(struct gspca_dev *gspca_dev)
1008 struct sd *sd = (struct sd *) gspca_dev; 1008 struct sd *sd = (struct sd *) gspca_dev;
1009 int avg_lum = atomic_read(&sd->avg_lum); 1009 int avg_lum = atomic_read(&sd->avg_lum);
1010 1010
1011 if (avg_lum == -1 || !sd->ctrls[AUTOGAIN].val) 1011 if ((gspca_dev->ctrl_dis & (1 << AUTOGAIN)) ||
1012 avg_lum == -1 || !sd->ctrls[AUTOGAIN].val)
1012 return; 1013 return;
1013 1014
1014 if (sd->autogain_ignore_frames > 0) { 1015 if (sd->autogain_ignore_frames > 0) {
@@ -1062,6 +1063,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
1062 sd->bridge = id->driver_info & 0xff; 1063 sd->bridge = id->driver_info & 0xff;
1063 1064
1064 gspca_dev->ctrl_dis = sensor_data[sd->sensor].ctrl_dis; 1065 gspca_dev->ctrl_dis = sensor_data[sd->sensor].ctrl_dis;
1066#if AUTOGAIN_DEF
1067 if (!(gspca_dev->ctrl_dis & (1 << AUTOGAIN)))
1068 gspca_dev->ctrl_inac = (1 << GAIN) | (1 << EXPOSURE);
1069#endif
1065 1070
1066 cam = &gspca_dev->cam; 1071 cam = &gspca_dev->cam;
1067 cam->ctrls = sd->ctrls; 1072 cam->ctrls = sd->ctrls;
@@ -1400,6 +1405,11 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
1400 } 1405 }
1401 } 1406 }
1402 1407
1408 if (sd->ctrls[AUTOGAIN].val)
1409 gspca_dev->ctrl_inac = (1 << GAIN) | (1 << EXPOSURE);
1410 else
1411 gspca_dev->ctrl_inac = 0;
1412
1403 return 0; 1413 return 0;
1404} 1414}
1405 1415