* [PATCH] OMAP: McBSP: Add 32-bit mode support
@ 2010-05-13 15:48 Sergey Lapin
2010-05-13 15:48 ` Mark Brown
2010-05-14 10:14 ` Liam Girdwood
0 siblings, 2 replies; 5+ messages in thread
From: Sergey Lapin @ 2010-05-13 15:48 UTC (permalink / raw)
To: alsa-devel
Cc: Tony Lindgren, Liam Girdwood, linux-omap, Sergey Lapin,
Mark Brown
This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
or others.
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
---
sound/soc/omap/omap-mcbsp.c | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 8ad9dc9..2dead3f 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -295,8 +295,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].port_addr = port;
omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode;
- omap_mcbsp_dai_dma_params[id][substream->stream].data_type =
- OMAP_DMA_DATA_TYPE_S16;
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ omap_mcbsp_dai_dma_params[id][substream->stream].data_type =
+ 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,
&omap_mcbsp_dai_dma_params[id][substream->stream]);
@@ -330,6 +340,14 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16);
regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16);
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:
/* Unsupported PCM format */
return -EINVAL;
@@ -623,13 +641,15 @@ static struct snd_soc_dai_ops omap_mcbsp_dai_ops = {
.channels_min = 1, \
.channels_max = 16, \
.rates = OMAP_MCBSP_RATES, \
- .formats = SNDRV_PCM_FMTBIT_S16_LE, \
+ .formats = SNDRV_PCM_FMTBIT_S16_LE | \
+ SNDRV_PCM_FMTBIT_S32_LE, \
}, \
.capture = { \
.channels_min = 1, \
.channels_max = 16, \
.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, \
.private_data = &mcbsp_data[(link_id)].bus_id, \
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP: McBSP: Add 32-bit mode support
2010-05-13 15:48 [PATCH] OMAP: McBSP: Add 32-bit mode support Sergey Lapin
@ 2010-05-13 15:48 ` Mark Brown
2010-05-14 5:46 ` [alsa-devel] " Jarkko Nikula
2010-05-14 10:14 ` Liam Girdwood
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-05-13 15:48 UTC (permalink / raw)
To: Sergey Lapin; +Cc: alsa-devel, Tony Lindgren, linux-omap, Liam Girdwood
On Thu, May 13, 2010 at 07:48:16PM +0400, Sergey Lapin wrote:
> This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
> or others.
>
> Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] [PATCH] OMAP: McBSP: Add 32-bit mode support
2010-05-13 15:48 ` Mark Brown
@ 2010-05-14 5:46 ` Jarkko Nikula
2010-05-14 7:06 ` peter.ujfalusi
0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Nikula @ 2010-05-14 5:46 UTC (permalink / raw)
To: Mark Brown
Cc: Sergey Lapin, Tony Lindgren, alsa-devel, linux-omap,
Liam Girdwood
On Thu, 13 May 2010 16:48:57 +0100
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, May 13, 2010 at 07:48:16PM +0400, Sergey Lapin wrote:
> > This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
> > or others.
> >
> > Signed-off-by: Sergey Lapin <slapin@ossfans.org>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP: McBSP: Add 32-bit mode support
2010-05-14 5:46 ` [alsa-devel] " Jarkko Nikula
@ 2010-05-14 7:06 ` peter.ujfalusi
0 siblings, 0 replies; 5+ messages in thread
From: peter.ujfalusi @ 2010-05-14 7:06 UTC (permalink / raw)
To: jhnikula, broonie; +Cc: tony, slapin, linux-omap, alsa-devel, lrg
On Thu, 13 May 2010 16:48:57 +0100
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, May 13, 2010 at 07:48:16PM +0400, Sergey Lapin wrote:
> > This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
> > or others.
> >
> > Signed-off-by: Sergey Lapin <slapin@ossfans.org>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP: McBSP: Add 32-bit mode support
2010-05-13 15:48 [PATCH] OMAP: McBSP: Add 32-bit mode support Sergey Lapin
2010-05-13 15:48 ` Mark Brown
@ 2010-05-14 10:14 ` Liam Girdwood
1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-05-14 10:14 UTC (permalink / raw)
To: Sergey Lapin; +Cc: Tony Lindgren, alsa-devel, linux-omap, Mark Brown
On Thu, 2010-05-13 at 19:48 +0400, Sergey Lapin wrote:
> This patchs should allow to use 32-bit samples on e.g. TLV320AIC3x codec,
> or others.
>
> Signed-off-by: Sergey Lapin <slapin@ossfans.org>
> ---
Applied.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-14 10:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 15:48 [PATCH] OMAP: McBSP: Add 32-bit mode support Sergey Lapin
2010-05-13 15:48 ` Mark Brown
2010-05-14 5:46 ` [alsa-devel] " Jarkko Nikula
2010-05-14 7:06 ` peter.ujfalusi
2010-05-14 10:14 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).