asoc: restrict sample rate and size in Freescale MPC8610 sound drivers
Subsystems (3)
PATCH 1/1 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.
---
Please apply this patch for 2.6.26.1 and for 2.6.27-rc1. Without this patch, recording on the MPC8610 is just plain broken, so it is a must-fix for 2.6.26.
sound/soc/fsl/fsl_dma.c | 7 ++++- sound/soc/fsl/fsl_ssi.c | 66 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 11 deletions(-)
sound/soc/fsl/fsl_dma.c +6 -1
@@ -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 ,
sound/soc/fsl/fsl_ssi.c +56 -10
113 lines not on this page · raw message
Signature · 1 line
1.5.5
Quoted 5 lines · Timur Tabi
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.
Please ignore this version of the patch. I just posted an improved version, labeled "[PATCH v2]".
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale