aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/fsl_dma.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2008-07-28 18:04:39 -0400
committerTakashi Iwai <tiwai@suse.de>2008-07-29 06:27:10 -0400
commitbe41e941d5f1a48bde7f44d09d56e8d2605f98e1 (patch)
treef8f519262a5466623538ce73c1d1c8ef34b9169e /sound/soc/fsl/fsl_dma.c
parenta7b815169aae65072017efb1fba9dcecc82ba7c1 (diff)
ALSA: asoc: restrict sample rate and size in Freescale MPC8610 sound drivers
The Freescale MPC8610 SSI device has the option of using one clock for both transmit and receive (synchronous mode), or independent clocks (asynchronous). The SSI driver, however, programs the SSI into synchronous mode and then tries to program the clock registers independently. The result is that the wrong sample size is usually generated during recording. This patch fixes the discrepancy by restricting the sample rate and sample size of the playback and capture streams. The SSI driver remembers which stream is opened first. When a second stream is opened, that stream is constrained to the same sample rate and size as the first stream. A future version of this driver will lift the sample size restriction. Supporting independent sample rates is more difficult, because only certain codecs provide dual independent clocks. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/fsl/fsl_dma.c')
-rw-r--r--sound/soc/fsl/fsl_dma.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index da2bc5902864..7ceea2bba1f5 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -132,12 +132,17 @@ struct fsl_dma_private {
132 * Since each link descriptor has a 32-bit byte count field, we set 132 * Since each link descriptor has a 32-bit byte count field, we set
133 * period_bytes_max to the largest 32-bit number. We also have no maximum 133 * period_bytes_max to the largest 32-bit number. We also have no maximum
134 * number of periods. 134 * number of periods.
135 *
136 * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a
137 * limitation in the SSI driver requires the sample rates for playback and
138 * capture to be the same.
135 */ 139 */
136static const struct snd_pcm_hardware fsl_dma_hardware = { 140static const struct snd_pcm_hardware fsl_dma_hardware = {
137 141
138 .info = SNDRV_PCM_INFO_INTERLEAVED | 142 .info = SNDRV_PCM_INFO_INTERLEAVED |
139 SNDRV_PCM_INFO_MMAP | 143 SNDRV_PCM_INFO_MMAP |
140 SNDRV_PCM_INFO_MMAP_VALID, 144 SNDRV_PCM_INFO_MMAP_VALID |
145 SNDRV_PCM_INFO_JOINT_DUPLEX,
141 .formats = FSLDMA_PCM_FORMATS, 146 .formats = FSLDMA_PCM_FORMATS,
142 .rates = FSLDMA_PCM_RATES, 147 .rates = FSLDMA_PCM_RATES,
143 .rate_min = 5512, 148 .rate_min = 5512,