summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx88/cx88-core.c
diff options
context:
space:
mode:
authorRicardo Cerqueira <v4l@cerqueira.org>2006-08-17 18:40:28 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 12:30:32 -0300
commite738e35d1e9ae15b597c713e0b74e9a535020c0d (patch)
treeb5bf56f45307ae39412add8a1c9b028b86763b6f /drivers/media/video/cx88/cx88-core.c
parent4e318bef68e819f001a3c8af65401891893d3d54 (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>
Diffstat (limited to 'drivers/media/video/cx88/cx88-core.c')
-rw-r--r--drivers/media/video/cx88/cx88-core.c10
1 files changed, 10 insertions, 0 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)
{
/* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */
int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4;
+
+ /* If downstream RISC is enabled, bail out; ALSA is managing DMA */
+ if (cx_read(MO_AUD_DMACNTRL) & 0x10)
+ return 0;
+
/* setup fifo + format */
cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0);
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)
/* start dma */
cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */
+
return 0;
}
int cx88_stop_audio_dma(struct cx88_core *core)
{
+ /* If downstream RISC is enabled, bail out; ALSA is managing DMA */
+ if (cx_read(MO_AUD_DMACNTRL) & 0x10)
+ return 0;
+
/* stop dma */
cx_write(MO_AUD_DMACNTRL, 0x0000);