public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sn9c20x: fixed exposure control for HV7131R sensor
@ 2009-10-19 21:55 German Galkin
  2009-11-24 12:54 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: German Galkin @ 2009-10-19 21:55 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media

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

Signed-off-by: German Galkin <galkinga@gmail.com>
---
diff --git a/drivers/media/video/gspca/sn9c20x.c
b/drivers/media/video/gspca/sn9c20x.c
index 99632a7..f173b35 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -1656,9 +1656,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;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-24 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 21:55 [PATCH] sn9c20x: fixed exposure control for HV7131R sensor German Galkin
2009-11-24 12:54 ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox