diff mbox

ASoC: davinci-mcasp: Fix S24_LE and U24_LE support

Message ID 1403759364-14524-1-git-send-email-peter.ujfalusi@ti.com (mailing list archive)
State Accepted
Commit 182bef863cc37a9a387ae9bc0f1b05243234bd4a
Headers show

Commit Message

Peter Ujfalusi June 26, 2014, 5:09 a.m. UTC
In case of S24_LE/U24_LE modes we expect 24bits on the bus while the samples
are stored and transferred in memory on 32bits (lower 3 bytes of the 4
bytes).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/davinci/davinci-mcasp.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Daniel Mack June 26, 2014, 7:29 a.m. UTC | #1
On 06/26/2014 07:09 AM, Peter Ujfalusi wrote:
> In case of S24_LE/U24_LE modes we expect 24bits on the bus while the samples
> are stored and transferred in memory on 32bits (lower 3 bytes of the 4
> bytes).
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Tested-by: Daniel Mack <daniel@zonque.org>


Thanks!
Daniel

> ---
>  sound/soc/davinci/davinci-mcasp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index 9afb14629a17..6d5de26eae2f 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -720,6 +720,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
>  
>  	case SNDRV_PCM_FORMAT_U24_LE:
>  	case SNDRV_PCM_FORMAT_S24_LE:
> +		dma_params->data_type = 4;
> +		word_length = 24;
> +		break;
> +
>  	case SNDRV_PCM_FORMAT_U32_LE:
>  	case SNDRV_PCM_FORMAT_S32_LE:
>  		dma_params->data_type = 4;
>
Mark Brown June 30, 2014, 2:53 p.m. UTC | #2
On Thu, Jun 26, 2014 at 08:09:24AM +0300, Peter Ujfalusi wrote:
> In case of S24_LE/U24_LE modes we expect 24bits on the bus while the samples
> are stored and transferred in memory on 32bits (lower 3 bytes of the 4
> bytes).

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 9afb14629a17..6d5de26eae2f 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -720,6 +720,10 @@  static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
 
 	case SNDRV_PCM_FORMAT_U24_LE:
 	case SNDRV_PCM_FORMAT_S24_LE:
+		dma_params->data_type = 4;
+		word_length = 24;
+		break;
+
 	case SNDRV_PCM_FORMAT_U32_LE:
 	case SNDRV_PCM_FORMAT_S32_LE:
 		dma_params->data_type = 4;