Commit d98508a1 authored by Sergey Lapin's avatar Sergey Lapin Committed by Liam Girdwood

OMAP: McBSP: Add 32-bit mode support

This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
or others.
Signed-off-by: default avatarSergey Lapin <slapin@ossfans.org>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 36aeff61
...@@ -320,8 +320,18 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -320,8 +320,18 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
omap_mcbsp_dai_dma_params[id][substream->stream].dma_req = dma; omap_mcbsp_dai_dma_params[id][substream->stream].dma_req = dma;
omap_mcbsp_dai_dma_params[id][substream->stream].port_addr = port; omap_mcbsp_dai_dma_params[id][substream->stream].port_addr = port;
omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode; omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode;
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
omap_mcbsp_dai_dma_params[id][substream->stream].data_type = omap_mcbsp_dai_dma_params[id][substream->stream].data_type =
OMAP_DMA_DATA_TYPE_S16; OMAP_DMA_DATA_TYPE_S16;
break;
case SNDRV_PCM_FORMAT_S32_LE:
omap_mcbsp_dai_dma_params[id][substream->stream].data_type =
OMAP_DMA_DATA_TYPE_S32;
break;
default:
return -EINVAL;
}
snd_soc_dai_set_dma_data(cpu_dai, substream, snd_soc_dai_set_dma_data(cpu_dai, substream,
&omap_mcbsp_dai_dma_params[id][substream->stream]); &omap_mcbsp_dai_dma_params[id][substream->stream]);
...@@ -356,6 +366,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -356,6 +366,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16); regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16);
regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16); regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16);
break; break;
case SNDRV_PCM_FORMAT_S32_LE:
/* Set word lengths */
wlen = 32;
regs->rcr2 |= RWDLEN2(OMAP_MCBSP_WORD_32);
regs->rcr1 |= RWDLEN1(OMAP_MCBSP_WORD_32);
regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_32);
regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_32);
break;
default: default:
/* Unsupported PCM format */ /* Unsupported PCM format */
return -EINVAL; return -EINVAL;
...@@ -659,13 +677,15 @@ static struct snd_soc_dai_ops omap_mcbsp_dai_ops = { ...@@ -659,13 +677,15 @@ static struct snd_soc_dai_ops omap_mcbsp_dai_ops = {
.channels_min = 1, \ .channels_min = 1, \
.channels_max = 16, \ .channels_max = 16, \
.rates = OMAP_MCBSP_RATES, \ .rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \ }, \
.capture = { \ .capture = { \
.channels_min = 1, \ .channels_min = 1, \
.channels_max = 16, \ .channels_max = 16, \
.rates = OMAP_MCBSP_RATES, \ .rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, \ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S32_LE, \
}, \ }, \
.ops = &omap_mcbsp_dai_ops, \ .ops = &omap_mcbsp_dai_ops, \
.private_data = &mcbsp_data[(link_id)].bus_id, \ .private_data = &mcbsp_data[(link_id)].bus_id, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment