diff mbox

[v2,05/11] ov534: Fix and document setting manual exposure

Message ID 1267444414-29248-1-git-send-email-ospite@studenti.unina.it (mailing list archive)
State Accepted
Headers show

Commit Message

Antonio Ospite March 1, 2010, 11:53 a.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
@@ -686,6 +686,15 @@ 
 	struct sd *sd = (struct sd *) gspca_dev;
 	u8 val;
 
+	if (sd->aec)
+		return;
+
+	/* 'val' is one byte and represents half of the exposure value we are
+	 * going to set into registers, a two bytes value:
+	 * 
+	 *    MSB: ((u16) val << 1) >> 8   == val >> 7
+	 *    LSB: ((u16) val << 1) & 0xff == val << 1
+	 */
 	val = sd->exposure;
 	sccb_reg_write(gspca_dev, 0x08, val >> 7);
 	sccb_reg_write(gspca_dev, 0x10, val << 1);