Skip to content

Commit

Permalink
V4L/DVB (13142): gspca_mr97310a: small tweak to CIF sensor type 1 exp…
Browse files Browse the repository at this point in the history
…osure 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>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 2052601 commit d76f975
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/video/gspca/mr97310a.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,9 @@ static void setexposure(struct gspca_dev *gspca_dev)
return;

if (sd->cam_type == CAM_TYPE_CIF && sd->sensor_type == 1) {
/* This cam does not like very low exposure settings */
exposure = (sd->exposure < 300) ? 300 : sd->exposure;
/* This cam does not like exposure settings > 300,
so scale 0 - 4095 to 300 - 4095 */
exposure = (sd->exposure * 9267) / 10000 + 300;
sensor_write1(gspca_dev, 3, exposure >> 4);
sensor_write1(gspca_dev, 4, exposure & 0x0f);
} else {
Expand Down

0 comments on commit d76f975

Please sign in to comment.