diff mbox

[5/5] soc-camera: tw9910: Add revision control on tw9910_set_hsync

Message ID ubpkbkfm9.wl%morimoto.kuninori@renesas.com (mailing list archive)
State RFC
Headers show

Commit Message

Kuninori Morimoto Oct. 13, 2009, 5:49 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index 59158bb..a688c11 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -349,6 +349,7 @@  static int tw9910_set_scale(struct i2c_client *client,
 static int tw9910_set_hsync(struct i2c_client *client,
 			    const u16 start, const u16 end)
 {
+	struct tw9910_priv *priv = to_tw9910(client);
 	int ret;
 
 	/* bit 10 - 3 */
@@ -363,15 +364,22 @@  static int tw9910_set_hsync(struct i2c_client *client,
 	if (ret < 0)
 		return ret;
 
-	/* bit 2 - 0 */
-	ret = i2c_smbus_read_byte_data(client, HSLOWCTL);
-	if (ret < 0)
-		return ret;
+	/* FIXME
+	 *
+	 * So far only revisions 0 and 1 have been seen
+	 */
+	if (1 == priv->rev) {
 
-	ret = i2c_smbus_write_byte_data(client, HSLOWCTL,
-					(ret   & 0x88)        |
-					(start & 0x0007) << 4 |
-					(end   & 0x0007));
+		/* bit 2 - 0 */
+		ret = i2c_smbus_read_byte_data(client, HSLOWCTL);
+		if (ret < 0)
+			return ret;
+
+		ret = i2c_smbus_write_byte_data(client, HSLOWCTL,
+						(ret   & 0x88)        |
+						(start & 0x0007) << 4 |
+						(end   & 0x0007));
+	}
 
 	return ret;
 }