]> err.no Git - linux-2.6/commitdiff
V4L/DVB (4504): Enable audio DMA restart on channel change even when cx88-alsa is...
authorRicardo Cerqueira <v4l@cerqueira.org>
Thu, 17 Aug 2006 21:40:28 +0000 (18:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 26 Sep 2006 15:30:32 +0000 (12:30 -0300)
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>
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-tvaudio.c

index d72e177607a7c59ceb2ab6c27768297a059eecfb..888ccb671e6c494c0d7f6afbf9570ab278c15c40 100644 (file)
@@ -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);
 
index cbd85feec922e712878a51a289c2ebaec2b2980e..741e7c5e69ec7085d2d68cb53f05dddef74ad9e1 100644 (file)
@@ -137,14 +137,10 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
 {
        u32 volume;
 
-#ifndef CONFIG_VIDEO_CX88_ALSA
        /* restart dma; This avoids buzz in NICAM and is good in others  */
        cx88_stop_audio_dma(core);
-#endif
        cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
-#ifndef CONFIG_VIDEO_CX88_ALSA
        cx88_start_audio_dma(core);
-#endif
 
        if (cx88_boards[core->board].blackbird) {
                /* sets sound input from external adc */