aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/mr97310a.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-10-11 04:22:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:32 -0500
commitd76f975c574230fb00d07848d330e04d97e51475 (patch)
treed9ef5cd5acf8af4e6cae0d1cfb33dc6920e939c5 /drivers/media/video/gspca/mr97310a.c
parent205260102c5cef4180982eec88aaeb6934faf214 (diff)
V4L/DVB (13142): gspca_mr97310a: small tweak to CIF sensor type 1 exposure setting
The CIF sensor type 1 exposure setting got clamped at 300, as settings below 300 do not work well (and do work for the other sensors). This patch scales the 0-4095 range to 300-4095 instead of ignoring changes between 300, avoiding have a part of the control range where nothing happens. This is esp. important for software autogain as done by libv4l. 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/mr97310a.c')
-rw-r--r--drivers/media/video/gspca/mr97310a.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
index abc56e37efcb..f282f8000701 100644
--- a/drivers/media/video/gspca/mr97310a.c
+++ b/drivers/media/video/gspca/mr97310a.c
@@ -842,8 +842,9 @@ static void setexposure(struct gspca_dev *gspca_dev)
842 return; 842 return;
843 843
844 if (sd->cam_type == CAM_TYPE_CIF && sd->sensor_type == 1) { 844 if (sd->cam_type == CAM_TYPE_CIF && sd->sensor_type == 1) {
845 /* This cam does not like very low exposure settings */ 845 /* This cam does not like exposure settings > 300,
846 exposure = (sd->exposure < 300) ? 300 : sd->exposure; 846 so scale 0 - 4095 to 300 - 4095 */
847 exposure = (sd->exposure * 9267) / 10000 + 300;
847 sensor_write1(gspca_dev, 3, exposure >> 4); 848 sensor_write1(gspca_dev, 3, exposure >> 4);
848 sensor_write1(gspca_dev, 4, exposure & 0x0f); 849 sensor_write1(gspca_dev, 4, exposure & 0x0f);
849 } else { 850 } else {