Commit e10f7319 authored by German Galkin's avatar German Galkin Committed by Mauro Carvalho Chehab

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: default avatarGerman Galkin <galkinga@gmail.com>
Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 24f222e7
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment