diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-core.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index b4049de071a2..cf634606ba9a 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -231,7 +231,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf) | |||
231 | * can use the whole SDRAM for the DMA fifos. To simplify things, we | 231 | * can use the whole SDRAM for the DMA fifos. To simplify things, we |
232 | * use a static memory layout. That surely will waste memory in case | 232 | * use a static memory layout. That surely will waste memory in case |
233 | * we don't use all DMA channels at the same time (which will be the | 233 | * we don't use all DMA channels at the same time (which will be the |
234 | * case most of the time). But that still gives us enougth FIFO space | 234 | * case most of the time). But that still gives us enough FIFO space |
235 | * to be able to deal with insane long pci latencies ... | 235 | * to be able to deal with insane long pci latencies ... |
236 | * | 236 | * |
237 | * FIFO space allocations: | 237 | * FIFO space allocations: |
@@ -241,6 +241,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf) | |||
241 | * channel 24 (vbi) - 4.0k | 241 | * channel 24 (vbi) - 4.0k |
242 | * channels 25+26 (audio) - 4.0k | 242 | * channels 25+26 (audio) - 4.0k |
243 | * channel 28 (mpeg) - 4.0k | 243 | * channel 28 (mpeg) - 4.0k |
244 | * channel 27 (audio rds)- 3.0k | ||
244 | * TOTAL = 29.0k | 245 | * TOTAL = 29.0k |
245 | * | 246 | * |
246 | * Every channel has 160 bytes control data (64 bytes instruction | 247 | * Every channel has 160 bytes control data (64 bytes instruction |
@@ -337,6 +338,18 @@ struct sram_channel cx88_sram_channels[] = { | |||
337 | .cnt1_reg = MO_DMA28_CNT1, | 338 | .cnt1_reg = MO_DMA28_CNT1, |
338 | .cnt2_reg = MO_DMA28_CNT2, | 339 | .cnt2_reg = MO_DMA28_CNT2, |
339 | }, | 340 | }, |
341 | [SRAM_CH27] = { | ||
342 | .name = "audio rds", | ||
343 | .cmds_start = 0x1801C0, | ||
344 | .ctrl_start = 0x180860, | ||
345 | .cdt = 0x180860 + 64, | ||
346 | .fifo_start = 0x187400, | ||
347 | .fifo_size = 0x000C00, | ||
348 | .ptr1_reg = MO_DMA27_PTR1, | ||
349 | .ptr2_reg = MO_DMA27_PTR2, | ||
350 | .cnt1_reg = MO_DMA27_CNT1, | ||
351 | .cnt2_reg = MO_DMA27_CNT2, | ||
352 | }, | ||
340 | }; | 353 | }; |
341 | 354 | ||
342 | int cx88_sram_channel_setup(struct cx88_core *core, | 355 | int cx88_sram_channel_setup(struct cx88_core *core, |
@@ -598,6 +611,7 @@ int cx88_reset(struct cx88_core *core) | |||
598 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); | 611 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); |
599 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); | 612 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); |
600 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 188*4, 0); | 613 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 188*4, 0); |
614 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH27], 128, 0); | ||
601 | 615 | ||
602 | /* misc init ... */ | 616 | /* misc init ... */ |
603 | cx_write(MO_INPUT_FORMAT, ((1 << 13) | // agc enable | 617 | cx_write(MO_INPUT_FORMAT, ((1 << 13) | // agc enable |
@@ -796,6 +810,8 @@ int cx88_start_audio_dma(struct cx88_core *core) | |||
796 | /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */ | 810 | /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */ |
797 | int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4; | 811 | int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4; |
798 | 812 | ||
813 | int rds_bpl = cx88_sram_channels[SRAM_CH27].fifo_size/AUD_RDS_LINES; | ||
814 | |||
799 | /* If downstream RISC is enabled, bail out; ALSA is managing DMA */ | 815 | /* If downstream RISC is enabled, bail out; ALSA is managing DMA */ |
800 | if (cx_read(MO_AUD_DMACNTRL) & 0x10) | 816 | if (cx_read(MO_AUD_DMACNTRL) & 0x10) |
801 | return 0; | 817 | return 0; |
@@ -803,12 +819,14 @@ int cx88_start_audio_dma(struct cx88_core *core) | |||
803 | /* setup fifo + format */ | 819 | /* setup fifo + format */ |
804 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); | 820 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); |
805 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); | 821 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); |
822 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH27], | ||
823 | rds_bpl, 0); | ||
806 | 824 | ||
807 | cx_write(MO_AUDD_LNGTH, bpl); /* fifo bpl size */ | 825 | cx_write(MO_AUDD_LNGTH, bpl); /* fifo bpl size */ |
808 | cx_write(MO_AUDR_LNGTH, bpl); /* fifo bpl size */ | 826 | cx_write(MO_AUDR_LNGTH, rds_bpl); /* fifo bpl size */ |
809 | 827 | ||
810 | /* start dma */ | 828 | /* enable Up, Down and Audio RDS fifo */ |
811 | cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ | 829 | cx_write(MO_AUD_DMACNTRL, 0x0007); |
812 | 830 | ||
813 | return 0; | 831 | return 0; |
814 | } | 832 | } |