diff options
author | Timur Tabi <timur@freescale.com> | 2008-07-29 00:04:39 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-07-29 12:27:10 +0200 |
commit | be41e941d5f1a48bde7f44d09d56e8d2605f98e1 (patch) | |
tree | f8f519262a5466623538ce73c1d1c8ef34b9169e /sound/soc/fsl/fsl_dma.c | |
parent | ALSA: sound/soc/pxa/tosa.c: removed duplicated include (diff) | |
download | linux-be41e941d5f1a48bde7f44d09d56e8d2605f98e1.tar.xz linux-be41e941d5f1a48bde7f44d09d56e8d2605f98e1.zip |
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.c | 7 |
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 { * Since each link descriptor has a 32-bit byte count field, we set * period_bytes_max to the largest 32-bit number. We also have no maximum * number of periods. + * + * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a + * limitation in the SSI driver requires the sample rates for playback and + * capture to be the same. */ static const struct snd_pcm_hardware fsl_dma_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | - SNDRV_PCM_INFO_MMAP_VALID, + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_JOINT_DUPLEX, .formats = FSLDMA_PCM_FORMATS, .rates = FSLDMA_PCM_RATES, .rate_min = 5512, |