diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2006-10-16 15:51:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 05:50:55 -0500 |
commit | f24546a95ade39b9cd292f06f92232becbbf35ae (patch) | |
tree | 1553ce8fbe9bb77886c272e9036c2779c4f9a3fa | |
parent | 5b26c82f959e72cbd642ef4039a356ff8385cd58 (diff) |
V4L/DVB (4757): Cx88: determine whether or not to use external adc
Some cx88-blackbird boards use an external adc, but not necessarily
for all inputs. Thus, this needs to be configurable on the card level
for each input.
This patch allows for the usage of the external adc to be determined
by a bit setting in the cx88_input struct for cards based on the cx88
blackbird design.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 16 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 13 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 8 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 1 |
4 files changed, 25 insertions, 13 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 35979933cd0c..d7cf54b95319 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -281,18 +281,22 @@ struct cx88_board cx88_boards[] = { | |||
281 | .type = CX88_VMUX_TELEVISION, | 281 | .type = CX88_VMUX_TELEVISION, |
282 | .vmux = 0, | 282 | .vmux = 0, |
283 | .gpio0 = 0x0000bde2, | 283 | .gpio0 = 0x0000bde2, |
284 | .extadc = 1, | ||
284 | },{ | 285 | },{ |
285 | .type = CX88_VMUX_COMPOSITE1, | 286 | .type = CX88_VMUX_COMPOSITE1, |
286 | .vmux = 1, | 287 | .vmux = 1, |
287 | .gpio0 = 0x0000bde6, | 288 | .gpio0 = 0x0000bde6, |
289 | .extadc = 1, | ||
288 | },{ | 290 | },{ |
289 | .type = CX88_VMUX_SVIDEO, | 291 | .type = CX88_VMUX_SVIDEO, |
290 | .vmux = 2, | 292 | .vmux = 2, |
291 | .gpio0 = 0x0000bde6, | 293 | .gpio0 = 0x0000bde6, |
294 | .extadc = 1, | ||
292 | }}, | 295 | }}, |
293 | .radio = { | 296 | .radio = { |
294 | .type = CX88_RADIO, | 297 | .type = CX88_RADIO, |
295 | .gpio0 = 0x0000bd62, | 298 | .gpio0 = 0x0000bd62, |
299 | .extadc = 1, | ||
296 | }, | 300 | }, |
297 | .mpeg = CX88_MPEG_BLACKBIRD, | 301 | .mpeg = CX88_MPEG_BLACKBIRD, |
298 | }, | 302 | }, |
@@ -523,6 +527,7 @@ struct cx88_board cx88_boards[] = { | |||
523 | .input = {{ | 527 | .input = {{ |
524 | .type = CX88_VMUX_TELEVISION, | 528 | .type = CX88_VMUX_TELEVISION, |
525 | .vmux = 0, | 529 | .vmux = 0, |
530 | .extadc = 1, | ||
526 | }}, | 531 | }}, |
527 | .mpeg = CX88_MPEG_BLACKBIRD, | 532 | .mpeg = CX88_MPEG_BLACKBIRD, |
528 | }, | 533 | }, |
@@ -646,18 +651,22 @@ struct cx88_board cx88_boards[] = { | |||
646 | .type = CX88_VMUX_TELEVISION, | 651 | .type = CX88_VMUX_TELEVISION, |
647 | .vmux = 0, | 652 | .vmux = 0, |
648 | .gpio0 = 0x00009d80, | 653 | .gpio0 = 0x00009d80, |
654 | .extadc = 1, | ||
649 | },{ | 655 | },{ |
650 | .type = CX88_VMUX_COMPOSITE1, | 656 | .type = CX88_VMUX_COMPOSITE1, |
651 | .vmux = 1, | 657 | .vmux = 1, |
652 | .gpio0 = 0x00009d76, | 658 | .gpio0 = 0x00009d76, |
659 | .extadc = 1, | ||
653 | },{ | 660 | },{ |
654 | .type = CX88_VMUX_SVIDEO, | 661 | .type = CX88_VMUX_SVIDEO, |
655 | .vmux = 2, | 662 | .vmux = 2, |
656 | .gpio0 = 0x00009d76, | 663 | .gpio0 = 0x00009d76, |
664 | .extadc = 1, | ||
657 | }}, | 665 | }}, |
658 | .radio = { | 666 | .radio = { |
659 | .type = CX88_RADIO, | 667 | .type = CX88_RADIO, |
660 | .gpio0 = 0x00009d00, | 668 | .gpio0 = 0x00009d00, |
669 | .extadc = 1, | ||
661 | }, | 670 | }, |
662 | .mpeg = CX88_MPEG_BLACKBIRD, | 671 | .mpeg = CX88_MPEG_BLACKBIRD, |
663 | }, | 672 | }, |
@@ -790,19 +799,23 @@ struct cx88_board cx88_boards[] = { | |||
790 | .type = CX88_VMUX_COMPOSITE1, | 799 | .type = CX88_VMUX_COMPOSITE1, |
791 | .vmux = 0, | 800 | .vmux = 0, |
792 | .gpio0 = 0x0000cd73, | 801 | .gpio0 = 0x0000cd73, |
802 | .extadc = 1, | ||
793 | },{ | 803 | },{ |
794 | .type = CX88_VMUX_SVIDEO, | 804 | .type = CX88_VMUX_SVIDEO, |
795 | .vmux = 1, | 805 | .vmux = 1, |
796 | .gpio0 = 0x0000cd73, | 806 | .gpio0 = 0x0000cd73, |
807 | .extadc = 1, | ||
797 | },{ | 808 | },{ |
798 | .type = CX88_VMUX_TELEVISION, | 809 | .type = CX88_VMUX_TELEVISION, |
799 | .vmux = 3, | 810 | .vmux = 3, |
800 | .gpio0 = 0x0000cdb3, | 811 | .gpio0 = 0x0000cdb3, |
812 | .extadc = 1, | ||
801 | }}, | 813 | }}, |
802 | .radio = { | 814 | .radio = { |
803 | .type = CX88_RADIO, | 815 | .type = CX88_RADIO, |
804 | .vmux = 2, | 816 | .vmux = 2, |
805 | .gpio0 = 0x0000cdf3, | 817 | .gpio0 = 0x0000cdf3, |
818 | .extadc = 1, | ||
806 | }, | 819 | }, |
807 | .mpeg = CX88_MPEG_BLACKBIRD, | 820 | .mpeg = CX88_MPEG_BLACKBIRD, |
808 | }, | 821 | }, |
@@ -1293,14 +1306,17 @@ struct cx88_board cx88_boards[] = { | |||
1293 | .type = CX88_VMUX_TELEVISION, | 1306 | .type = CX88_VMUX_TELEVISION, |
1294 | .vmux = 0, | 1307 | .vmux = 0, |
1295 | .gpio0 = 0xe780, | 1308 | .gpio0 = 0xe780, |
1309 | .extadc = 1, | ||
1296 | },{ | 1310 | },{ |
1297 | .type = CX88_VMUX_COMPOSITE1, | 1311 | .type = CX88_VMUX_COMPOSITE1, |
1298 | .vmux = 1, | 1312 | .vmux = 1, |
1299 | .gpio0 = 0xe780, | 1313 | .gpio0 = 0xe780, |
1314 | .extadc = 1, | ||
1300 | },{ | 1315 | },{ |
1301 | .type = CX88_VMUX_SVIDEO, | 1316 | .type = CX88_VMUX_SVIDEO, |
1302 | .vmux = 2, | 1317 | .vmux = 2, |
1303 | .gpio0 = 0xe780, | 1318 | .gpio0 = 0xe780, |
1319 | .extadc = 1, | ||
1304 | }}, | 1320 | }}, |
1305 | /* fixme: Add radio support */ | 1321 | /* fixme: Add radio support */ |
1306 | .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, | 1322 | .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, |
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index 58ba9f773524..3482e0114d43 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -143,19 +143,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) | |||
143 | cx88_start_audio_dma(core); | 143 | cx88_start_audio_dma(core); |
144 | 144 | ||
145 | if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { | 145 | if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { |
146 | /* sets sound input from external adc */ | ||
147 | switch (core->board) { | ||
148 | case CX88_BOARD_HAUPPAUGE_ROSLYN: | ||
149 | case CX88_BOARD_KWORLD_MCE200_DELUXE: | ||
150 | case CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT: | ||
151 | case CX88_BOARD_PIXELVIEW_PLAYTV_P7000: | ||
152 | case CX88_BOARD_ASUS_PVR_416: | ||
153 | cx_clear(AUD_CTL, EN_I2SIN_ENABLE); | ||
154 | break; | ||
155 | default: | ||
156 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); | ||
157 | } | ||
158 | |||
159 | cx_write(AUD_I2SINPUTCNTL, 4); | 146 | cx_write(AUD_I2SINPUTCNTL, 4); |
160 | cx_write(AUD_BAUDRATE, 1); | 147 | cx_write(AUD_BAUDRATE, 1); |
161 | /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */ | 148 | /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */ |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index f27312189d79..8613378428fd 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -454,6 +454,14 @@ static int video_mux(struct cx88_core *core, unsigned int input) | |||
454 | cx_clear(MO_FILTER_ODD, 0x00002020); | 454 | cx_clear(MO_FILTER_ODD, 0x00002020); |
455 | break; | 455 | break; |
456 | } | 456 | } |
457 | |||
458 | if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { | ||
459 | /* sets sound input from external adc */ | ||
460 | if (INPUT(input)->extadc) | ||
461 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); | ||
462 | else | ||
463 | cx_clear(AUD_CTL, EN_I2SIN_ENABLE); | ||
464 | } | ||
457 | return 0; | 465 | return 0; |
458 | } | 466 | } |
459 | 467 | ||
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 5980e47aee13..7054e941f1d7 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -225,6 +225,7 @@ struct cx88_input { | |||
225 | enum cx88_itype type; | 225 | enum cx88_itype type; |
226 | unsigned int vmux; | 226 | unsigned int vmux; |
227 | u32 gpio0, gpio1, gpio2, gpio3; | 227 | u32 gpio0, gpio1, gpio2, gpio3; |
228 | unsigned int extadc:1; | ||
228 | }; | 229 | }; |
229 | 230 | ||
230 | struct cx88_board { | 231 | struct cx88_board { |