diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-11-18 20:20:47 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-11-18 20:20:47 +0000 |
commit | a96453548af345348c29b30dbdac678f151e3777 (patch) | |
tree | e6f251c5ebed37d635a3603172eb02a3c21eb4e6 /linux | |
parent | fa1881a251747f56aa80914be4448bcadca6baae (diff) | |
download | mediapointer-dvb-s2-a96453548af345348c29b30dbdac678f151e3777.tar.gz mediapointer-dvb-s2-a96453548af345348c29b30dbdac678f151e3777.tar.bz2 |
enabled audio DMA setting on cx88 chips, even when dma not in use
- enabled audio DMA transfer code even when DMA not in use
to solve a problem on some broken cx88 chips.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 39 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-tvaudio.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88.h | 6 |
3 files changed, 44 insertions, 11 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 22e6b3830..837790f6d 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-core.c,v 1.48 2005/11/18 15:13:50 mchehab Exp $ + * $Id: cx88-core.c,v 1.49 2005/11/18 20:20:47 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * driver core @@ -876,6 +876,29 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) return -1; } +int cx88_start_audio_dma(struct cx88_core *core) +{ + /* setup fifo + format */ + cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); + cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); + + cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */ + cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */ + + /* start dma */ + cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ + + return 0; +} + +int cx88_stop_audio_dma(struct cx88_core *core) +{ + /* stop dma */ + cx_write(MO_AUD_DMACNTRL, 0x0000); + + return 0; +} + static int set_tvaudio(struct cx88_core *core) { struct cx88_tvnorm *norm = core->tvnorm; @@ -916,14 +939,18 @@ static int set_tvaudio(struct cx88_core *core) cx88_set_tvaudio(core); /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ -#if 0 /* This is needed only on cx88-alsa */ - cx_write(MO_AUDD_LNGTH, 128); /* fifo size */ - cx_write(MO_AUDR_LNGTH, 128); /* fifo size */ - cx_write(MO_AUD_DMACNTRL, 0x03); /* need audio fifo */ +#if 1 +/* + This should be needed only on cx88-alsa. It seems that some cx88 chips have + bugs and does require DMA enabled for it to work. + */ + cx88_start_audio_dma(core); #endif return 0; } + + int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) { u32 fsc8; @@ -1249,6 +1276,8 @@ EXPORT_SYMBOL(cx88_set_scale); EXPORT_SYMBOL(cx88_vdev_init); EXPORT_SYMBOL(cx88_core_get); EXPORT_SYMBOL(cx88_core_put); +EXPORT_SYMBOL(cx88_start_audio_dma); +EXPORT_SYMBOL(cx88_stop_audio_dma); /* * Local variables: diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index bcdf321be..e5190ef96 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -1,5 +1,5 @@ /* - $Id: cx88-tvaudio.c,v 1.49 2005/11/18 15:07:08 mchehab Exp $ + $Id: cx88-tvaudio.c,v 1.50 2005/11/18 20:20:47 mchehab Exp $ cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver @@ -136,13 +136,13 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) { u32 volume; -#if 0 /* This is needed only with cx88-alsa */ +#if 1 /* restart dma; This avoids buzz in NICAM and is good in others */ - stop_audio_dma(core); + cx88_stop_audio_dma(core); #endif cx_write(AUD_RATE_THRES_DMD, 0x000000C0); -#if 0 /* This is needed only with cx88-alsa */ - start_audio_dma(core); +#if 1 + cx88_start_audio_dma(core); #endif if (cx88_boards[core->board].blackbird) { diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 592fba6bf..ca44308d9 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -1,5 +1,5 @@ /* - * $Id: cx88.h,v 1.89 2005/11/13 18:11:21 mkrufky Exp $ + * $Id: cx88.h,v 1.90 2005/11/18 20:20:47 mchehab Exp $ * * v4l2 device driver for cx2388x based TV cards * @@ -527,6 +527,10 @@ extern struct cx88_core* cx88_core_get(struct pci_dev *pci); extern void cx88_core_put(struct cx88_core *core, struct pci_dev *pci); +extern int cx88_start_audio_dma(struct cx88_core *core); +extern int cx88_stop_audio_dma(struct cx88_core *core); + + /* ----------------------------------------------------------- */ /* cx88-vbi.c */ |