* [PATCH] ASoC: TWL4030: Fix 24bit support
@ 2010-12-14 11:45 Peter Ujfalusi
2010-12-14 11:49 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2010-12-14 11:45 UTC (permalink / raw)
To: alsa-devel; +Cc: Mark Brown, Liam Girdwood
twl4030 series of codecs supports S32_LE with msbits=24.
Replace the S24_LE with S32_LE format, and add constraint
for 24msbit in case of 32 S32_LE format.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
sound/soc/codecs/twl4030.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index c173cf0..e4d464b 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1724,6 +1724,7 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
struct snd_soc_codec *codec = rtd->codec;
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
+ snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
if (twl4030->master_substream) {
twl4030->slave_substream = substream;
/* The DAI has one configuration for playback and capture, so
@@ -1848,7 +1849,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream,
case SNDRV_PCM_FORMAT_S16_LE:
format |= TWL4030_DATA_WIDTH_16S_16W;
break;
- case SNDRV_PCM_FORMAT_S24_LE:
+ case SNDRV_PCM_FORMAT_S32_LE:
format |= TWL4030_DATA_WIDTH_32S_24W;
break;
default:
@@ -2181,7 +2182,7 @@ static int twl4030_voice_set_tristate(struct snd_soc_dai *dai, int tristate)
}
#define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000)
-#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE)
+#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_ops twl4030_dai_hifi_ops = {
.startup = twl4030_startup,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: TWL4030: Fix 24bit support
2010-12-14 11:45 [PATCH] ASoC: TWL4030: Fix 24bit support Peter Ujfalusi
@ 2010-12-14 11:49 ` Mark Brown
2010-12-14 12:11 ` Peter Ujfalusi
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-12-14 11:49 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood
On Tue, Dec 14, 2010 at 01:45:29PM +0200, Peter Ujfalusi wrote:
> twl4030 series of codecs supports S32_LE with msbits=24.
> Replace the S24_LE with S32_LE format, and add constraint
> for 24msbit in case of 32 S32_LE format.
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
There's no real need to add the constraint for 24 bit - the CODEC will
quite happily consume 32 bit data, it'll just ignore the 8 LSB. We
should probably do something more sensible with the format stuff, it's
never been a terribly pressing issue though.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: TWL4030: Fix 24bit support
2010-12-14 11:49 ` Mark Brown
@ 2010-12-14 12:11 ` Peter Ujfalusi
2010-12-14 12:35 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2010-12-14 12:11 UTC (permalink / raw)
To: alsa-devel; +Cc: ext Mark Brown, Liam Girdwood
On Tuesday 14 December 2010 13:49:14 ext Mark Brown wrote:
> On Tue, Dec 14, 2010 at 01:45:29PM +0200, Peter Ujfalusi wrote:
> > twl4030 series of codecs supports S32_LE with msbits=24.
> > Replace the S24_LE with S32_LE format, and add constraint
> > for 24msbit in case of 32 S32_LE format.
> >
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
>
> There's no real need to add the constraint for 24 bit - the CODEC will
> quite happily consume 32 bit data, it'll just ignore the 8 LSB. We
> should probably do something more sensible with the format stuff, it's
> never been a terribly pressing issue though.
AFAIK this constraint is for applications to know, that only the 24 bit MSB is
valid in S32_LE (for example the ice1712 also sets this constraint to let
application know).
The datasheet of twl4030 series states, that it supports this coding, so IMHO it
does not hurt to let applications know this fact.
But yeah, it will discard the the 8 bit LSB for sure.
--
Péter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: TWL4030: Fix 24bit support
2010-12-14 12:11 ` Peter Ujfalusi
@ 2010-12-14 12:35 ` Mark Brown
2010-12-14 20:05 ` Liam Girdwood
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-12-14 12:35 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood
On Tue, Dec 14, 2010 at 02:11:00PM +0200, Peter Ujfalusi wrote:
> AFAIK this constraint is for applications to know, that only the 24 bit MSB is
> valid in S32_LE (for example the ice1712 also sets this constraint to let
> application know).
Hrm, yeah.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: TWL4030: Fix 24bit support
2010-12-14 12:35 ` Mark Brown
@ 2010-12-14 20:05 ` Liam Girdwood
0 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-12-14 20:05 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Peter Ujfalusi
On Tue, 2010-12-14 at 12:35 +0000, Mark Brown wrote:
> On Tue, Dec 14, 2010 at 02:11:00PM +0200, Peter Ujfalusi wrote:
>
> > AFAIK this constraint is for applications to know, that only the 24 bit MSB is
> > valid in S32_LE (for example the ice1712 also sets this constraint to let
> > application know).
>
> Hrm, yeah.
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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-12-14 20:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14 11:45 [PATCH] ASoC: TWL4030: Fix 24bit support Peter Ujfalusi
2010-12-14 11:49 ` Mark Brown
2010-12-14 12:11 ` Peter Ujfalusi
2010-12-14 12:35 ` Mark Brown
2010-12-14 20:05 ` Liam Girdwood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.