diff options
author | Ricardo Cerqueira <v4l@cerqueira.org> | 2007-09-30 12:02:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:03:48 -0500 |
commit | 7b27d45bb50498c86aa87e7ef174b2a0f5b6f361 (patch) | |
tree | 5518bfbfa0320a4529de0ce0265952dd441ccf17 /drivers/media/video/cx88 | |
parent | 4423a9a3395ef652d80d848161444b417f1f78c0 (diff) |
V4L/DVB (6831): Audio routes fix for blackbird boards with the wm8775 ADC
Fix lack of audio on the MPEG-2 stream of wm8775 based blackbirds.
The wm8775 module initializes the audio input at "route 2", which doesn't
hold true for all boards. The HVR-1300, for example, uses route 1 for
tuner audio, and route 2 for baseband. So we must route the audio to the
proper input depending on what video input is being used.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 38 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 16 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 2 |
3 files changed, 34 insertions, 22 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index f8a786ae4758..d484e5ce579c 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -302,22 +302,22 @@ static const struct cx88_board cx88_boards[] = { | |||
302 | .type = CX88_VMUX_TELEVISION, | 302 | .type = CX88_VMUX_TELEVISION, |
303 | .vmux = 0, | 303 | .vmux = 0, |
304 | .gpio0 = 0x0000bde2, | 304 | .gpio0 = 0x0000bde2, |
305 | .extadc = 1, | 305 | .audioroute = 1, |
306 | },{ | 306 | },{ |
307 | .type = CX88_VMUX_COMPOSITE1, | 307 | .type = CX88_VMUX_COMPOSITE1, |
308 | .vmux = 1, | 308 | .vmux = 1, |
309 | .gpio0 = 0x0000bde6, | 309 | .gpio0 = 0x0000bde6, |
310 | .extadc = 1, | 310 | .audioroute = 1, |
311 | },{ | 311 | },{ |
312 | .type = CX88_VMUX_SVIDEO, | 312 | .type = CX88_VMUX_SVIDEO, |
313 | .vmux = 2, | 313 | .vmux = 2, |
314 | .gpio0 = 0x0000bde6, | 314 | .gpio0 = 0x0000bde6, |
315 | .extadc = 1, | 315 | .audioroute = 1, |
316 | }}, | 316 | }}, |
317 | .radio = { | 317 | .radio = { |
318 | .type = CX88_RADIO, | 318 | .type = CX88_RADIO, |
319 | .gpio0 = 0x0000bd62, | 319 | .gpio0 = 0x0000bd62, |
320 | .extadc = 1, | 320 | .audioroute = 1, |
321 | }, | 321 | }, |
322 | .mpeg = CX88_MPEG_BLACKBIRD, | 322 | .mpeg = CX88_MPEG_BLACKBIRD, |
323 | }, | 323 | }, |
@@ -378,7 +378,7 @@ static const struct cx88_board cx88_boards[] = { | |||
378 | .type = CX88_VMUX_SVIDEO, | 378 | .type = CX88_VMUX_SVIDEO, |
379 | .vmux = 2, | 379 | .vmux = 2, |
380 | .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? | 380 | .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? |
381 | .extadc = 1, | 381 | .audioroute = 1, |
382 | }}, | 382 | }}, |
383 | .radio = { | 383 | .radio = { |
384 | .type = CX88_RADIO, | 384 | .type = CX88_RADIO, |
@@ -549,7 +549,7 @@ static const struct cx88_board cx88_boards[] = { | |||
549 | .input = {{ | 549 | .input = {{ |
550 | .type = CX88_VMUX_TELEVISION, | 550 | .type = CX88_VMUX_TELEVISION, |
551 | .vmux = 0, | 551 | .vmux = 0, |
552 | .extadc = 1, | 552 | .audioroute = 1, |
553 | }}, | 553 | }}, |
554 | .mpeg = CX88_MPEG_BLACKBIRD, | 554 | .mpeg = CX88_MPEG_BLACKBIRD, |
555 | }, | 555 | }, |
@@ -672,22 +672,22 @@ static const struct cx88_board cx88_boards[] = { | |||
672 | .type = CX88_VMUX_TELEVISION, | 672 | .type = CX88_VMUX_TELEVISION, |
673 | .vmux = 0, | 673 | .vmux = 0, |
674 | .gpio0 = 0x00009d80, | 674 | .gpio0 = 0x00009d80, |
675 | .extadc = 1, | 675 | .audioroute = 1, |
676 | },{ | 676 | },{ |
677 | .type = CX88_VMUX_COMPOSITE1, | 677 | .type = CX88_VMUX_COMPOSITE1, |
678 | .vmux = 1, | 678 | .vmux = 1, |
679 | .gpio0 = 0x00009d76, | 679 | .gpio0 = 0x00009d76, |
680 | .extadc = 1, | 680 | .audioroute = 1, |
681 | },{ | 681 | },{ |
682 | .type = CX88_VMUX_SVIDEO, | 682 | .type = CX88_VMUX_SVIDEO, |
683 | .vmux = 2, | 683 | .vmux = 2, |
684 | .gpio0 = 0x00009d76, | 684 | .gpio0 = 0x00009d76, |
685 | .extadc = 1, | 685 | .audioroute = 1, |
686 | }}, | 686 | }}, |
687 | .radio = { | 687 | .radio = { |
688 | .type = CX88_RADIO, | 688 | .type = CX88_RADIO, |
689 | .gpio0 = 0x00009d00, | 689 | .gpio0 = 0x00009d00, |
690 | .extadc = 1, | 690 | .audioroute = 1, |
691 | }, | 691 | }, |
692 | .mpeg = CX88_MPEG_BLACKBIRD, | 692 | .mpeg = CX88_MPEG_BLACKBIRD, |
693 | }, | 693 | }, |
@@ -826,23 +826,23 @@ static const struct cx88_board cx88_boards[] = { | |||
826 | .type = CX88_VMUX_COMPOSITE1, | 826 | .type = CX88_VMUX_COMPOSITE1, |
827 | .vmux = 0, | 827 | .vmux = 0, |
828 | .gpio0 = 0x0000cd73, | 828 | .gpio0 = 0x0000cd73, |
829 | .extadc = 1, | 829 | .audioroute = 1, |
830 | },{ | 830 | },{ |
831 | .type = CX88_VMUX_SVIDEO, | 831 | .type = CX88_VMUX_SVIDEO, |
832 | .vmux = 1, | 832 | .vmux = 1, |
833 | .gpio0 = 0x0000cd73, | 833 | .gpio0 = 0x0000cd73, |
834 | .extadc = 1, | 834 | .audioroute = 1, |
835 | },{ | 835 | },{ |
836 | .type = CX88_VMUX_TELEVISION, | 836 | .type = CX88_VMUX_TELEVISION, |
837 | .vmux = 3, | 837 | .vmux = 3, |
838 | .gpio0 = 0x0000cdb3, | 838 | .gpio0 = 0x0000cdb3, |
839 | .extadc = 1, | 839 | .audioroute = 1, |
840 | }}, | 840 | }}, |
841 | .radio = { | 841 | .radio = { |
842 | .type = CX88_RADIO, | 842 | .type = CX88_RADIO, |
843 | .vmux = 2, | 843 | .vmux = 2, |
844 | .gpio0 = 0x0000cdf3, | 844 | .gpio0 = 0x0000cdf3, |
845 | .extadc = 1, | 845 | .audioroute = 1, |
846 | }, | 846 | }, |
847 | .mpeg = CX88_MPEG_BLACKBIRD, | 847 | .mpeg = CX88_MPEG_BLACKBIRD, |
848 | }, | 848 | }, |
@@ -1110,12 +1110,12 @@ static const struct cx88_board cx88_boards[] = { | |||
1110 | .type = CX88_VMUX_COMPOSITE1, | 1110 | .type = CX88_VMUX_COMPOSITE1, |
1111 | .vmux = 1, | 1111 | .vmux = 1, |
1112 | .gpio0 = 0x3de6, | 1112 | .gpio0 = 0x3de6, |
1113 | .extadc = 1, | 1113 | .audioroute = 1, |
1114 | },{ | 1114 | },{ |
1115 | .type = CX88_VMUX_SVIDEO, | 1115 | .type = CX88_VMUX_SVIDEO, |
1116 | .vmux = 2, | 1116 | .vmux = 2, |
1117 | .gpio0 = 0x3de6, | 1117 | .gpio0 = 0x3de6, |
1118 | .extadc = 1, | 1118 | .audioroute = 1, |
1119 | }}, | 1119 | }}, |
1120 | .radio = { | 1120 | .radio = { |
1121 | .type = CX88_RADIO, | 1121 | .type = CX88_RADIO, |
@@ -1340,17 +1340,17 @@ static const struct cx88_board cx88_boards[] = { | |||
1340 | .type = CX88_VMUX_TELEVISION, | 1340 | .type = CX88_VMUX_TELEVISION, |
1341 | .vmux = 0, | 1341 | .vmux = 0, |
1342 | .gpio0 = 0xe780, | 1342 | .gpio0 = 0xe780, |
1343 | .extadc = 1, | 1343 | .audioroute = 1, |
1344 | },{ | 1344 | },{ |
1345 | .type = CX88_VMUX_COMPOSITE1, | 1345 | .type = CX88_VMUX_COMPOSITE1, |
1346 | .vmux = 1, | 1346 | .vmux = 1, |
1347 | .gpio0 = 0xe780, | 1347 | .gpio0 = 0xe780, |
1348 | .extadc = 1, | 1348 | .audioroute = 2, |
1349 | },{ | 1349 | },{ |
1350 | .type = CX88_VMUX_SVIDEO, | 1350 | .type = CX88_VMUX_SVIDEO, |
1351 | .vmux = 2, | 1351 | .vmux = 2, |
1352 | .gpio0 = 0xe780, | 1352 | .gpio0 = 0xe780, |
1353 | .extadc = 1, | 1353 | .audioroute = 2, |
1354 | }}, | 1354 | }}, |
1355 | /* fixme: Add radio support */ | 1355 | /* fixme: Add radio support */ |
1356 | .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, | 1356 | .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 6d5ea8ce9830..1b80f0f700e6 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -394,9 +394,21 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) | |||
394 | 394 | ||
395 | if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { | 395 | if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { |
396 | /* sets sound input from external adc */ | 396 | /* sets sound input from external adc */ |
397 | if (INPUT(input).extadc) | 397 | if (INPUT(input).audioroute) { |
398 | /* The wm8775 module has the "2" route hardwired into | ||
399 | the initialization. Some boards may use different | ||
400 | routes for different inputs. HVR-1300 surely does */ | ||
401 | if (core->board.audio_chip && | ||
402 | core->board.audio_chip == AUDIO_CHIP_WM8775) { | ||
403 | struct v4l2_routing route; | ||
404 | |||
405 | route.input = INPUT(input).audioroute; | ||
406 | cx88_call_i2c_clients(core, | ||
407 | VIDIOC_INT_S_AUDIO_ROUTING,&route); | ||
408 | } | ||
409 | |||
398 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); | 410 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); |
399 | else | 411 | } else |
400 | cx_clear(AUD_CTL, EN_I2SIN_ENABLE); | 412 | cx_clear(AUD_CTL, EN_I2SIN_ENABLE); |
401 | } | 413 | } |
402 | return 0; | 414 | return 0; |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index f10d432eb3eb..a10f94de0d31 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -228,7 +228,7 @@ struct cx88_input { | |||
228 | enum cx88_itype type; | 228 | enum cx88_itype type; |
229 | u32 gpio0, gpio1, gpio2, gpio3; | 229 | u32 gpio0, gpio1, gpio2, gpio3; |
230 | unsigned int vmux:2; | 230 | unsigned int vmux:2; |
231 | unsigned int extadc:1; | 231 | unsigned int audioroute; |
232 | }; | 232 | }; |
233 | 233 | ||
234 | struct cx88_board { | 234 | struct cx88_board { |