* [PATCH 4/4] soc-camera: tw9910: modify tw9910_set_hsync to use revision control
@ 2009-11-02 3:13 Kuninori Morimoto
0 siblings, 0 replies; only message in thread
From: Kuninori Morimoto @ 2009-11-02 3:13 UTC (permalink / raw)
To: Guennadi; +Cc: V4L-Linux
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.
Register name typo was also modified.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
---
drivers/media/video/tw9910.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index b3f5703..c836ee5 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -117,7 +117,7 @@
#define LCTL24 0x68
#define LCTL25 0x69
#define LCTL26 0x6A
-#define HSGEGIN 0x6B
+#define HSBEGIN 0x6B
#define HSEND 0x6C
#define OVSDLY 0x6D
#define OVSEND 0x6E
@@ -435,10 +435,11 @@ static int tw9910_set_cropping(struct i2c_client *client,
static int tw9910_set_hsync(struct i2c_client *client,
const struct tw9910_hsync_ctrl *hsync)
{
+ struct tw9910_priv *priv = to_tw9910(client);
int ret;
/* bit 10 - 3 */
- ret = i2c_smbus_write_byte_data(client, HSGEGIN,
+ ret = i2c_smbus_write_byte_data(client, HSBEGIN,
(hsync->start & 0x07F8) >> 3);
if (ret < 0)
return ret;
@@ -449,10 +450,12 @@ static int tw9910_set_hsync(struct i2c_client *client,
if (ret < 0)
return ret;
+ /* So far only revisions 0 and 1 have been seen */
/* bit 2 - 0 */
- ret = tw9910_mask_set(client, HSLOWCTL, 0x77,
- (hsync->start & 0x0007) << 4 |
- (hsync->end & 0x0007));
+ if (1 == priv->rev)
+ ret = tw9910_mask_set(client, HSLOWCTL, 0x77,
+ (hsync->start & 0x0007) << 4 |
+ (hsync->end & 0x0007));
return ret;
}
--
1.6.0.4
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-02 3:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 3:13 [PATCH 4/4] soc-camera: tw9910: modify tw9910_set_hsync to use revision control Kuninori Morimoto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.