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/drivers') 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