]> git.karo-electronics.de Git - linux-beck.git/commitdiff
V4L/DVB: gspca - sn9c20x: Fix exposure control for HV7131R sensor
authorGerman Galkin <galkinga@gmail.com>
Sun, 7 Mar 2010 09:19:02 +0000 (06:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:46:29 +0000 (00:46 -0300)
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>
drivers/media/video/gspca/sn9c20x.c

index 3dee3e5844b6b4ea790aeddc1b51dc72212f6231..04bf80ddfbb86ecf370542301e2a5c27110e60ad 100644 (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;