diff mbox

[05/11] ov534: Fix setting manual exposure

Message ID 1267302028-7941-6-git-send-email-ospite@studenti.unina.it (mailing list archive)
State Superseded
Headers show

Commit Message

Antonio Ospite Feb. 27, 2010, 8:20 p.m. UTC
None
diff mbox

Patch

Index: gspca/linux/drivers/media/video/gspca/ov534.c
===================================================================
--- gspca.orig/linux/drivers/media/video/gspca/ov534.c
+++ gspca/linux/drivers/media/video/gspca/ov534.c
@@ -59,7 +59,7 @@ 
 	u8 brightness;
 	u8 contrast;
 	u8 gain;
-	u8 exposure;
+	u16 exposure;
 	u8 agc;
 	u8 awb;
 	u8 aec;
@@ -140,7 +140,7 @@ 
 	    .type    = V4L2_CTRL_TYPE_INTEGER,
 	    .name    = "Exposure",
 	    .minimum = 0,
-	    .maximum = 255,
+	    .maximum = 506,
 	    .step    = 1,
 #define EXPO_DEF 120
 	    .default_value = EXPO_DEF,
@@ -684,11 +684,15 @@ 
 static void setexposure(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	u8 val;
+	u16 val;
+
+	if (sd->aec)
+		return;
 
 	val = sd->exposure;
-	sccb_reg_write(gspca_dev, 0x08, val >> 7);
-	sccb_reg_write(gspca_dev, 0x10, val << 1);
+	sccb_reg_write(gspca_dev, 0x08, val >> 8);
+	sccb_reg_write(gspca_dev, 0x10, val & 0xff);
+
 }
 
 static void setagc(struct gspca_dev *gspca_dev)