diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-12-01 03:51:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-01 18:48:57 -0500 |
commit | 6f502b8a7858ecfa7d2a0762f7663b8b3d0808fc (patch) | |
tree | b6f6ef7e9918324136eabb506c37f7b91bd647b2 /drivers | |
parent | c87c948ebd75525df4d67dd5b40e6ea81859cc17 (diff) |
[PATCH] V4L: Enables 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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 32 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 3 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 4 |
3 files changed, 39 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index b18e7a33081a..bb6eb54e19ce 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -837,6 +837,29 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) | |||
837 | return -1; | 837 | return -1; |
838 | } | 838 | } |
839 | 839 | ||
840 | int cx88_start_audio_dma(struct cx88_core *core) | ||
841 | { | ||
842 | /* setup fifo + format */ | ||
843 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); | ||
844 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); | ||
845 | |||
846 | cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */ | ||
847 | cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */ | ||
848 | |||
849 | /* start dma */ | ||
850 | cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ | ||
851 | |||
852 | return 0; | ||
853 | } | ||
854 | |||
855 | int cx88_stop_audio_dma(struct cx88_core *core) | ||
856 | { | ||
857 | /* stop dma */ | ||
858 | cx_write(MO_AUD_DMACNTRL, 0x0000); | ||
859 | |||
860 | return 0; | ||
861 | } | ||
862 | |||
840 | static int set_tvaudio(struct cx88_core *core) | 863 | static int set_tvaudio(struct cx88_core *core) |
841 | { | 864 | { |
842 | struct cx88_tvnorm *norm = core->tvnorm; | 865 | struct cx88_tvnorm *norm = core->tvnorm; |
@@ -877,9 +900,16 @@ static int set_tvaudio(struct cx88_core *core) | |||
877 | cx88_set_tvaudio(core); | 900 | cx88_set_tvaudio(core); |
878 | /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ | 901 | /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ |
879 | 902 | ||
903 | /* | ||
904 | This should be needed only on cx88-alsa. It seems that some cx88 chips have | ||
905 | bugs and does require DMA enabled for it to work. | ||
906 | */ | ||
907 | cx88_start_audio_dma(core); | ||
880 | return 0; | 908 | return 0; |
881 | } | 909 | } |
882 | 910 | ||
911 | |||
912 | |||
883 | int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) | 913 | int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) |
884 | { | 914 | { |
885 | u32 fsc8; | 915 | u32 fsc8; |
@@ -1201,6 +1231,8 @@ EXPORT_SYMBOL(cx88_set_scale); | |||
1201 | EXPORT_SYMBOL(cx88_vdev_init); | 1231 | EXPORT_SYMBOL(cx88_vdev_init); |
1202 | EXPORT_SYMBOL(cx88_core_get); | 1232 | EXPORT_SYMBOL(cx88_core_get); |
1203 | EXPORT_SYMBOL(cx88_core_put); | 1233 | EXPORT_SYMBOL(cx88_core_put); |
1234 | EXPORT_SYMBOL(cx88_start_audio_dma); | ||
1235 | EXPORT_SYMBOL(cx88_stop_audio_dma); | ||
1204 | 1236 | ||
1205 | /* | 1237 | /* |
1206 | * Local variables: | 1238 | * Local variables: |
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index a9059c53a418..a1b120c8a9b5 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -132,7 +132,10 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) | |||
132 | { | 132 | { |
133 | u32 volume; | 133 | u32 volume; |
134 | 134 | ||
135 | /* restart dma; This avoids buzz in NICAM and is good in others */ | ||
136 | cx88_stop_audio_dma(core); | ||
135 | cx_write(AUD_RATE_THRES_DMD, 0x000000C0); | 137 | cx_write(AUD_RATE_THRES_DMD, 0x000000C0); |
138 | cx88_start_audio_dma(core); | ||
136 | 139 | ||
137 | if (cx88_boards[core->board].blackbird) { | 140 | if (cx88_boards[core->board].blackbird) { |
138 | /* sets sound input from external adc */ | 141 | /* sets sound input from external adc */ |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index b19d3a9e2298..27fb080fd7aa 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -491,6 +491,10 @@ extern struct cx88_core* cx88_core_get(struct pci_dev *pci); | |||
491 | extern void cx88_core_put(struct cx88_core *core, | 491 | extern void cx88_core_put(struct cx88_core *core, |
492 | struct pci_dev *pci); | 492 | struct pci_dev *pci); |
493 | 493 | ||
494 | extern int cx88_start_audio_dma(struct cx88_core *core); | ||
495 | extern int cx88_stop_audio_dma(struct cx88_core *core); | ||
496 | |||
497 | |||
494 | /* ----------------------------------------------------------- */ | 498 | /* ----------------------------------------------------------- */ |
495 | /* cx88-vbi.c */ | 499 | /* cx88-vbi.c */ |
496 | 500 | ||