diff options
author | Ricardo Cerqueira <v4l@cerqueira.org> | 2006-08-17 17:40:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 11:30:32 -0400 |
commit | e738e35d1e9ae15b597c713e0b74e9a535020c0d (patch) | |
tree | b5bf56f45307ae39412add8a1c9b028b86763b6f | |
parent | 4e318bef68e819f001a3c8af65401891893d3d54 (diff) |
V4L/DVB (4504): Enable audio DMA restart on channel change even when cx88-alsa is compiled
cx88-alsa can be compiled in (in distro built kernels, for example), but
not used. In those cases, the audio DMA restart is needed for proper sound
on NICAM channels.
This patch enables the DMA restart even with ALSA, but the functions now
check if cx88-alsa is really active.
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 10 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index d72e177607a7..888ccb671e6c 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -792,6 +792,11 @@ int cx88_start_audio_dma(struct cx88_core *core) | |||
792 | { | 792 | { |
793 | /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */ | 793 | /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */ |
794 | int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4; | 794 | int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4; |
795 | |||
796 | /* If downstream RISC is enabled, bail out; ALSA is managing DMA */ | ||
797 | if (cx_read(MO_AUD_DMACNTRL) & 0x10) | ||
798 | return 0; | ||
799 | |||
795 | /* setup fifo + format */ | 800 | /* setup fifo + format */ |
796 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); | 801 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); |
797 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); | 802 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); |
@@ -801,11 +806,16 @@ int cx88_start_audio_dma(struct cx88_core *core) | |||
801 | 806 | ||
802 | /* start dma */ | 807 | /* start dma */ |
803 | cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ | 808 | cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ |
809 | |||
804 | return 0; | 810 | return 0; |
805 | } | 811 | } |
806 | 812 | ||
807 | int cx88_stop_audio_dma(struct cx88_core *core) | 813 | int cx88_stop_audio_dma(struct cx88_core *core) |
808 | { | 814 | { |
815 | /* If downstream RISC is enabled, bail out; ALSA is managing DMA */ | ||
816 | if (cx_read(MO_AUD_DMACNTRL) & 0x10) | ||
817 | return 0; | ||
818 | |||
809 | /* stop dma */ | 819 | /* stop dma */ |
810 | cx_write(MO_AUD_DMACNTRL, 0x0000); | 820 | cx_write(MO_AUD_DMACNTRL, 0x0000); |
811 | 821 | ||
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index cbd85feec922..741e7c5e69ec 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -137,14 +137,10 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) | |||
137 | { | 137 | { |
138 | u32 volume; | 138 | u32 volume; |
139 | 139 | ||
140 | #ifndef CONFIG_VIDEO_CX88_ALSA | ||
141 | /* restart dma; This avoids buzz in NICAM and is good in others */ | 140 | /* restart dma; This avoids buzz in NICAM and is good in others */ |
142 | cx88_stop_audio_dma(core); | 141 | cx88_stop_audio_dma(core); |
143 | #endif | ||
144 | cx_write(AUD_RATE_THRES_DMD, 0x000000C0); | 142 | cx_write(AUD_RATE_THRES_DMD, 0x000000C0); |
145 | #ifndef CONFIG_VIDEO_CX88_ALSA | ||
146 | cx88_start_audio_dma(core); | 143 | cx88_start_audio_dma(core); |
147 | #endif | ||
148 | 144 | ||
149 | if (cx88_boards[core->board].blackbird) { | 145 | if (cx88_boards[core->board].blackbird) { |
150 | /* sets sound input from external adc */ | 146 | /* sets sound input from external adc */ |