From eb706c154c6ea0c8827ceb8b644e8ab2858f2b77 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Sep 2006 03:01:44 -0300 Subject: saa7115 seems to need initializing some reserved registers From: Mauro Carvalho Chehab Also fixed a scaling trouble Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/saa7115.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c index 54336578a..ca27c8c4d 100644 --- a/linux/drivers/media/video/saa7115.c +++ b/linux/drivers/media/video/saa7115.c @@ -104,6 +104,8 @@ static inline int saa711x_write(struct i2c_client *client, u8 reg, u8 value) /* Sanity routine to check if a register is present */ static int saa711x_has_reg(const int id, const u8 reg) { +#if 0 + /* saa7115 seems to needing to initialize some "reserved" registers */ switch (id) { case V4L2_IDENT_SAA7111: if (reg>0x1f || reg==1 || reg==0x0f || reg==0x14 || reg==0x18 @@ -115,7 +117,7 @@ static int saa711x_has_reg(const int id, const u8 reg) return 0; case V4L2_IDENT_SAA7114: if (reg>=0xf0 || (reg>=0x1a && reg<=0x1e) || - (reg>=0x20 && reg<=0x2f) || + (reg>=0x20 && reg<=0x2f) || (reg>=0x63 && reg<=0x7f) ) return 0; case V4L2_IDENT_SAA7115: @@ -134,7 +136,7 @@ static int saa711x_has_reg(const int id, const u8 reg) (reg>=0x3b && reg<=0x3f) || (reg==0x5f) || (reg>=0x63 && reg<=0x6f) ) ) return 0; - +#endif return 1; } @@ -1064,7 +1066,7 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) int VSCY; int res; int is_50hz = state->std & V4L2_STD_625_50; - int Vsrc = is_50hz ? 576 : 480; + int Vsrc = is_50hz ? 576 : 480+16; v4l_dbg(1, debug, client, "decoder set size to %ix%i\n",width,height); @@ -1081,7 +1083,7 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) if (height != Vsrc) return -EINVAL; } - if (!saa711x_has_reg(state->ident,R_CC_B_HORIZ_OUTPUT_WINDOW_LENGTH)) + if (!saa711x_has_reg(state->ident,R_CC_B_HORIZ_OUTPUT_WINDOW_LENGTH)) return 0; /* probably have a valid size, let's set it */ @@ -1096,14 +1098,6 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) /* Vertical Scaling uses height/2 */ res=height/2; - /*FIXME: This code seems weird, however, this is how it is - * working right now. - */ - if (height == Vsrc) { - if (!is_50hz) - res+=8; - } - /* height */ saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH, (u8) (res & 0xff)); -- cgit v1.2.3 From 474d4b00ce885b4cc9c49d1fa50ae14f9628ddd8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Sep 2006 09:21:45 -0300 Subject: For contributers, it seems to be better to describe what changed From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-i2c.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c index 5a1114666..79cf9d9ee 100644 --- a/linux/drivers/media/video/cx88/cx88-i2c.c +++ b/linux/drivers/media/video/cx88/cx88-i2c.c @@ -6,7 +6,9 @@ & Marcus Metzler (mocm@thp.uni-koeln.de) (c) 2002 Yurij Sysoev (c) 1999-2003 Gerd Knorr + (c) 2005 Mauro Carvalho Chehab + - Multituner support and i2c address binding This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From 2d72251dd36d87853a8a8cb5949d4719968a2cde Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Sep 2006 09:37:11 -0300 Subject: Fix: There were some missing breaks at register check routine From: Mauro Carvalho Chehab Without the breaks, saa7115 were not initializing PLL2. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/saa7115.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c index ca27c8c4d..31d9ee396 100644 --- a/linux/drivers/media/video/saa7115.c +++ b/linux/drivers/media/video/saa7115.c @@ -104,26 +104,28 @@ static inline int saa711x_write(struct i2c_client *client, u8 reg, u8 value) /* Sanity routine to check if a register is present */ static int saa711x_has_reg(const int id, const u8 reg) { -#if 0 - /* saa7115 seems to needing to initialize some "reserved" registers */ switch (id) { case V4L2_IDENT_SAA7111: if (reg>0x1f || reg==1 || reg==0x0f || reg==0x14 || reg==0x18 || reg==0x19 || reg==0x1d || reg==0x1e) return 0; + break; case V4L2_IDENT_SAA7113: if (reg>0x62 || reg==0x14 || (reg>=0x18 && reg<=0x1e) || (reg>=0x20 && reg<=0x3f) ||reg==0x5f ) return 0; + break; case V4L2_IDENT_SAA7114: if (reg>=0xf0 || (reg>=0x1a && reg<=0x1e) || (reg>=0x20 && reg<=0x2f) || (reg>=0x63 && reg<=0x7f) ) return 0; + break; case V4L2_IDENT_SAA7115: if ((reg>=0x20 && reg<=0x2f) || (reg==0x5c) || (reg>=0xfc && reg<=0xfe) ) return 0; + break; case V4L2_IDENT_SAA7118: if (reg>=0xf0 || (reg>=0x1a && reg<=0x1d) || (reg>=0x63 && reg<=0x6f) ) @@ -136,7 +138,6 @@ static int saa711x_has_reg(const int id, const u8 reg) (reg>=0x3b && reg<=0x3f) || (reg==0x5f) || (reg>=0x63 && reg<=0x6f) ) ) return 0; -#endif return 1; } @@ -154,6 +155,8 @@ static int saa711x_writeregs(struct i2c_client *client, const unsigned char *reg if (saa711x_has_reg(state->ident,reg)) { if (saa711x_write(client, reg, data) < 0) return -1; + } else { + v4l_dbg(1, debug, client, "tried to access reserved reg 0x%02x\n", reg); } } return 0; -- cgit v1.2.3