10 - 3 bit hsync control are same as Rev0/Rev1.
But only rev1 can control more 3 bit for hsync.
This patch modify this problem

Signed-off-by: Kuninori Morimoto <morimoto.kunin...@renesas.com>
---
 drivers/media/video/tw9910.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

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;
 }
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to