diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2005-12-01 03:51:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-01 18:48:58 -0500 |
commit | f95006f89576cac504323daa53157013bf099fc9 (patch) | |
tree | 1ee888856e45f1f6c9546fae5e64341674b9d320 /drivers/media/video/cx25840 | |
parent | 0fe22865ddee524017a1012528b0e15475acc942 (diff) |
[PATCH] V4L: Add workaround for Hauppauge PVR150 with certain NTSC tuner models
Add workaround for Hauppauge PVR150 hardware problem with tuner models 85, 99
and 112 (model numbers as reported by tveeprom). The audio standard
autodetection does not always work correctly for these models.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 34 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840.h | 9 |
2 files changed, 40 insertions, 3 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 539db129a9f4..aea3f038cff6 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -208,8 +208,11 @@ static void cx25840_initialize(struct i2c_client *client, int loadfw) | |||
208 | 208 | ||
209 | static void input_change(struct i2c_client *client) | 209 | static void input_change(struct i2c_client *client) |
210 | { | 210 | { |
211 | struct cx25840_state *state = i2c_get_clientdata(client); | ||
211 | v4l2_std_id std = cx25840_get_v4lstd(client); | 212 | v4l2_std_id std = cx25840_get_v4lstd(client); |
212 | 213 | ||
214 | /* Note: perhaps V4L2_STD_PAL_M should be handled as V4L2_STD_NTSC | ||
215 | instead of V4L2_STD_PAL. Someone needs to test this. */ | ||
213 | if (std & V4L2_STD_PAL) { | 216 | if (std & V4L2_STD_PAL) { |
214 | /* Follow tuner change procedure for PAL */ | 217 | /* Follow tuner change procedure for PAL */ |
215 | cx25840_write(client, 0x808, 0xff); | 218 | cx25840_write(client, 0x808, 0xff); |
@@ -220,7 +223,32 @@ static void input_change(struct i2c_client *client) | |||
220 | cx25840_write(client, 0x80b, 0x10); | 223 | cx25840_write(client, 0x80b, 0x10); |
221 | } else if (std & V4L2_STD_NTSC) { | 224 | } else if (std & V4L2_STD_NTSC) { |
222 | /* NTSC */ | 225 | /* NTSC */ |
223 | cx25840_write(client, 0x808, 0xf6); | 226 | if (state->cardtype == CARDTYPE_PVR150_WORKAROUND) { |
227 | /* Certain Hauppauge PVR150 models have a hardware bug | ||
228 | that causes audio to drop out. For these models the | ||
229 | audio standard must be set explicitly. | ||
230 | To be precise: it affects cards with tuner models | ||
231 | 85, 99 and 112 (model numbers from tveeprom). */ | ||
232 | if (std == V4L2_STD_NTSC_M_JP) { | ||
233 | /* Japan uses EIAJ audio standard */ | ||
234 | cx25840_write(client, 0x808, 0x2f); | ||
235 | } else { | ||
236 | /* Others use the BTSC audio standard */ | ||
237 | cx25840_write(client, 0x808, 0x1f); | ||
238 | } | ||
239 | /* South Korea uses the A2-M (aka Zweiton M) audio | ||
240 | standard, and should set 0x808 to 0x3f, but I don't | ||
241 | know how to detect this. */ | ||
242 | } else if (std == V4L2_STD_NTSC_M_JP) { | ||
243 | /* Japan uses EIAJ audio standard */ | ||
244 | cx25840_write(client, 0x808, 0xf7); | ||
245 | } else { | ||
246 | /* Others use the BTSC audio standard */ | ||
247 | cx25840_write(client, 0x808, 0xf6); | ||
248 | } | ||
249 | /* South Korea uses the A2-M (aka Zweiton M) audio standard, | ||
250 | and should set 0x808 to 0xf8, but I don't know how to | ||
251 | detect this. */ | ||
224 | cx25840_write(client, 0x80b, 0x00); | 252 | cx25840_write(client, 0x80b, 0x00); |
225 | } | 253 | } |
226 | 254 | ||
@@ -241,7 +269,8 @@ static int set_input(struct i2c_client *client, enum cx25840_input input) | |||
241 | case CX25840_TUNER: | 269 | case CX25840_TUNER: |
242 | cx25840_dbg("now setting Tuner input\n"); | 270 | cx25840_dbg("now setting Tuner input\n"); |
243 | 271 | ||
244 | if (state->cardtype == CARDTYPE_PVR150) { | 272 | if (state->cardtype == CARDTYPE_PVR150 || |
273 | state->cardtype == CARDTYPE_PVR150_WORKAROUND) { | ||
245 | /* CH_SEL_ADC2=1 */ | 274 | /* CH_SEL_ADC2=1 */ |
246 | cx25840_and_or(client, 0x102, ~0x2, 0x02); | 275 | cx25840_and_or(client, 0x102, ~0x2, 0x02); |
247 | } | 276 | } |
@@ -363,6 +392,7 @@ static int set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) | |||
363 | case CX25840_CID_CARDTYPE: | 392 | case CX25840_CID_CARDTYPE: |
364 | switch (ctrl->value) { | 393 | switch (ctrl->value) { |
365 | case CARDTYPE_PVR150: | 394 | case CARDTYPE_PVR150: |
395 | case CARDTYPE_PVR150_WORKAROUND: | ||
366 | case CARDTYPE_PG600: | 396 | case CARDTYPE_PG600: |
367 | state->cardtype = ctrl->value; | 397 | state->cardtype = ctrl->value; |
368 | break; | 398 | break; |
diff --git a/drivers/media/video/cx25840/cx25840.h b/drivers/media/video/cx25840/cx25840.h index 5c3f0639fb77..4932ed1c9b19 100644 --- a/drivers/media/video/cx25840/cx25840.h +++ b/drivers/media/video/cx25840/cx25840.h | |||
@@ -40,9 +40,16 @@ extern int cx25840_debug; | |||
40 | 40 | ||
41 | #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) | 41 | #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) |
42 | 42 | ||
43 | /* The CARDTYPE_PVR150_WORKAROUND cardtype activates a workaround for a | ||
44 | hardware bug that is present in PVR150 (and possible PVR500) cards that | ||
45 | have certain NTSC tuners (tveeprom model numbers 85, 99 and 112). The | ||
46 | audio autodetect fails on some channels for these models and the workaround | ||
47 | is to select the audio standard explicitly. Many thanks to Hauppauge for | ||
48 | providing this information. */ | ||
43 | enum cx25840_cardtype { | 49 | enum cx25840_cardtype { |
44 | CARDTYPE_PVR150, | 50 | CARDTYPE_PVR150, |
45 | CARDTYPE_PG600 | 51 | CARDTYPE_PG600, |
52 | CARDTYPE_PVR150_WORKAROUND, | ||
46 | }; | 53 | }; |
47 | 54 | ||
48 | enum cx25840_input { | 55 | enum cx25840_input { |