diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-02-07 03:48:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-07 03:48:40 -0500 |
commit | d97a11e091a0bf40f1cfb0bbf443ddd7b455b133 (patch) | |
tree | 489727bd0a5cc8350ff5753b26b893dd1776791f | |
parent | 8a8832a8eb5a824261a63c22befb4a8c193d4d02 (diff) |
V4L/DVB (3300): Add standard for South Korean NTSC-M using A2 audio.
South Korea uses NTSC-M but with A2 audio instead of BTSC. Several audio
chips need this information in order to set the correct audio processing
registers.
Acked-by: Mauro Carvalho Chehab <mauro_chehab@yahoo.com.br>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/bttv-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 50 | ||||
-rw-r--r-- | drivers/media/video/tda9887.c | 7 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 5 | ||||
-rw-r--r-- | include/linux/videodev2.h | 4 |
5 files changed, 35 insertions, 33 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index aa4c4c521880..578b20085082 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -214,7 +214,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = { | |||
214 | we can capture, of the first and second field. */ | 214 | we can capture, of the first and second field. */ |
215 | .vbistart = { 7,320 }, | 215 | .vbistart = { 7,320 }, |
216 | },{ | 216 | },{ |
217 | .v4l2_id = V4L2_STD_NTSC_M, | 217 | .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR, |
218 | .name = "NTSC", | 218 | .name = "NTSC", |
219 | .Fsc = 28636363, | 219 | .Fsc = 28636363, |
220 | .swidth = 768, | 220 | .swidth = 768, |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 3acd587b160c..8d8aa8ec8304 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -220,33 +220,23 @@ static void input_change(struct i2c_client *client) | |||
220 | cx25840_write(client, 0x808, 0xff); | 220 | cx25840_write(client, 0x808, 0xff); |
221 | cx25840_write(client, 0x80b, 0x10); | 221 | cx25840_write(client, 0x80b, 0x10); |
222 | } else if (std & V4L2_STD_NTSC) { | 222 | } else if (std & V4L2_STD_NTSC) { |
223 | /* NTSC */ | 223 | /* Certain Hauppauge PVR150 models have a hardware bug |
224 | if (state->pvr150_workaround) { | 224 | that causes audio to drop out. For these models the |
225 | /* Certain Hauppauge PVR150 models have a hardware bug | 225 | audio standard must be set explicitly. |
226 | that causes audio to drop out. For these models the | 226 | To be precise: it affects cards with tuner models |
227 | audio standard must be set explicitly. | 227 | 85, 99 and 112 (model numbers from tveeprom). */ |
228 | To be precise: it affects cards with tuner models | 228 | int hw_fix = state->pvr150_workaround; |
229 | 85, 99 and 112 (model numbers from tveeprom). */ | 229 | |
230 | if (std == V4L2_STD_NTSC_M_JP) { | 230 | if (std == V4L2_STD_NTSC_M_JP) { |
231 | /* Japan uses EIAJ audio standard */ | ||
232 | cx25840_write(client, 0x808, 0x2f); | ||
233 | } else { | ||
234 | /* Others use the BTSC audio standard */ | ||
235 | cx25840_write(client, 0x808, 0x1f); | ||
236 | } | ||
237 | /* South Korea uses the A2-M (aka Zweiton M) audio | ||
238 | standard, and should set 0x808 to 0x3f, but I don't | ||
239 | know how to detect this. */ | ||
240 | } else if (std == V4L2_STD_NTSC_M_JP) { | ||
241 | /* Japan uses EIAJ audio standard */ | 231 | /* Japan uses EIAJ audio standard */ |
242 | cx25840_write(client, 0x808, 0xf7); | 232 | cx25840_write(client, 0x808, hw_fix ? 0x2f : 0xf7); |
233 | } else if (std == V4L2_STD_NTSC_M_KR) { | ||
234 | /* South Korea uses A2 audio standard */ | ||
235 | cx25840_write(client, 0x808, hw_fix ? 0x3f : 0xf8); | ||
243 | } else { | 236 | } else { |
244 | /* Others use the BTSC audio standard */ | 237 | /* Others use the BTSC audio standard */ |
245 | cx25840_write(client, 0x808, 0xf6); | 238 | cx25840_write(client, 0x808, hw_fix ? 0x1f : 0xf6); |
246 | } | 239 | } |
247 | /* South Korea uses the A2-M (aka Zweiton M) audio standard, | ||
248 | and should set 0x808 to 0xf8, but I don't know how to | ||
249 | detect this. */ | ||
250 | cx25840_write(client, 0x80b, 0x00); | 240 | cx25840_write(client, 0x80b, 0x00); |
251 | } | 241 | } |
252 | 242 | ||
@@ -330,17 +320,17 @@ static int set_v4lstd(struct i2c_client *client, v4l2_std_id std) | |||
330 | u8 fmt=0; /* zero is autodetect */ | 320 | u8 fmt=0; /* zero is autodetect */ |
331 | 321 | ||
332 | /* First tests should be against specific std */ | 322 | /* First tests should be against specific std */ |
333 | if (std & V4L2_STD_NTSC_M_JP) { | 323 | if (std == V4L2_STD_NTSC_M_JP) { |
334 | fmt=0x2; | 324 | fmt=0x2; |
335 | } else if (std & V4L2_STD_NTSC_443) { | 325 | } else if (std == V4L2_STD_NTSC_443) { |
336 | fmt=0x3; | 326 | fmt=0x3; |
337 | } else if (std & V4L2_STD_PAL_M) { | 327 | } else if (std == V4L2_STD_PAL_M) { |
338 | fmt=0x5; | 328 | fmt=0x5; |
339 | } else if (std & V4L2_STD_PAL_N) { | 329 | } else if (std == V4L2_STD_PAL_N) { |
340 | fmt=0x6; | 330 | fmt=0x6; |
341 | } else if (std & V4L2_STD_PAL_Nc) { | 331 | } else if (std == V4L2_STD_PAL_Nc) { |
342 | fmt=0x7; | 332 | fmt=0x7; |
343 | } else if (std & V4L2_STD_PAL_60) { | 333 | } else if (std == V4L2_STD_PAL_60) { |
344 | fmt=0x8; | 334 | fmt=0x8; |
345 | } else { | 335 | } else { |
346 | /* Then, test against generic ones */ | 336 | /* Then, test against generic ones */ |
@@ -369,7 +359,7 @@ v4l2_std_id cx25840_get_v4lstd(struct i2c_client * client) | |||
369 | } | 359 | } |
370 | 360 | ||
371 | switch (fmt) { | 361 | switch (fmt) { |
372 | case 0x1: return V4L2_STD_NTSC_M; | 362 | case 0x1: return V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR; |
373 | case 0x2: return V4L2_STD_NTSC_M_JP; | 363 | case 0x2: return V4L2_STD_NTSC_M_JP; |
374 | case 0x3: return V4L2_STD_NTSC_443; | 364 | case 0x3: return V4L2_STD_NTSC_443; |
375 | case 0x4: return V4L2_STD_PAL; | 365 | case 0x4: return V4L2_STD_PAL; |
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 7c71422f5d3f..0d54f6c1982b 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -231,7 +231,7 @@ static struct tvnorm tvnorms[] = { | |||
231 | cAudioIF_6_5 | | 231 | cAudioIF_6_5 | |
232 | cVideoIF_38_90 ), | 232 | cVideoIF_38_90 ), |
233 | },{ | 233 | },{ |
234 | .std = V4L2_STD_NTSC_M, | 234 | .std = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR, |
235 | .name = "NTSC-M", | 235 | .name = "NTSC-M", |
236 | .b = ( cNegativeFmTV | | 236 | .b = ( cNegativeFmTV | |
237 | cQSS ), | 237 | cQSS ), |
@@ -619,6 +619,11 @@ static int tda9887_fixup_std(struct tda9887 *t) | |||
619 | tda9887_dbg("insmod fixup: NTSC => NTSC_M_JP\n"); | 619 | tda9887_dbg("insmod fixup: NTSC => NTSC_M_JP\n"); |
620 | t->std = V4L2_STD_NTSC_M_JP; | 620 | t->std = V4L2_STD_NTSC_M_JP; |
621 | break; | 621 | break; |
622 | case 'k': | ||
623 | case 'K': | ||
624 | tda9887_dbg("insmod fixup: NTSC => NTSC_M_KR\n"); | ||
625 | t->std = V4L2_STD_NTSC_M_KR; | ||
626 | break; | ||
622 | case '-': | 627 | case '-': |
623 | /* default parameter, do nothing */ | 628 | /* default parameter, do nothing */ |
624 | break; | 629 | break; |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 788eadaae672..e34f801c9a10 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -366,6 +366,11 @@ static int tuner_fixup_std(struct tuner *t) | |||
366 | tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n"); | 366 | tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n"); |
367 | t->std = V4L2_STD_NTSC_M_JP; | 367 | t->std = V4L2_STD_NTSC_M_JP; |
368 | break; | 368 | break; |
369 | case 'k': | ||
370 | case 'K': | ||
371 | tuner_dbg("insmod fixup: NTSC => NTSC_M_KR\n"); | ||
372 | t->std = V4L2_STD_NTSC_M_KR; | ||
373 | break; | ||
369 | case '-': | 374 | case '-': |
370 | /* default parameter, do nothing */ | 375 | /* default parameter, do nothing */ |
371 | break; | 376 | break; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 6e33ce96cab0..965c8902fe60 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -638,6 +638,7 @@ typedef __u64 v4l2_std_id; | |||
638 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) | 638 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) |
639 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) | 639 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) |
640 | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) | 640 | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) |
641 | #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) | ||
641 | 642 | ||
642 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) | 643 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) |
643 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) | 644 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) |
@@ -670,7 +671,8 @@ typedef __u64 v4l2_std_id; | |||
670 | V4L2_STD_PAL_H |\ | 671 | V4L2_STD_PAL_H |\ |
671 | V4L2_STD_PAL_I) | 672 | V4L2_STD_PAL_I) |
672 | #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ | 673 | #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ |
673 | V4L2_STD_NTSC_M_JP) | 674 | V4L2_STD_NTSC_M_JP |\ |
675 | V4L2_STD_NTSC_M_KR) | ||
674 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ | 676 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ |
675 | V4L2_STD_SECAM_K |\ | 677 | V4L2_STD_SECAM_K |\ |
676 | V4L2_STD_SECAM_K1) | 678 | V4L2_STD_SECAM_K1) |