V4L/DVB: gspca - sn9c20x: Fix exposure control for HV7131R sensor

Make the range of exposure values (0-0x1770) distribute evenly through
HV7131R's exposure control bytes.

Signed-off-by: German Galkin <galkinga@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
German Galkin 2010-03-07 06:19:02 -03:00 committed by Mauro Carvalho Chehab
parent 24f222e77a
commit e10f73194d

View File

@ -1655,9 +1655,9 @@ static int set_exposure(struct gspca_dev *gspca_dev)
case SENSOR_HV7131R:
exp[0] |= (4 << 4);
exp[2] = 0x25;
exp[3] = ((sd->exposure * 0xffffff) / 0xffff) >> 16;
exp[4] = ((sd->exposure * 0xffffff) / 0xffff) >> 8;
exp[5] = ((sd->exposure * 0xffffff) / 0xffff) & 0xff;
exp[3] = (sd->exposure >> 5) & 0xff;
exp[4] = (sd->exposure << 3) & 0xff;
exp[5] = 0;
break;
default:
return 0;