diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-12-14 06:45:29 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-12-14 14:59:50 -0500 |
commit | dcdeda4a60b2046dd18d3dd20cbd888f25d8916b (patch) | |
tree | e09860db054be9e9aa0e2838fc8569ba14e5ee80 /sound | |
parent | a6cea9655bfa821dbf53c6fffb9b2b99fe77367c (diff) |
ASoC: TWL4030: Fix 24bit support
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>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r-- | 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 c173cf00f5c..e4d464b937d 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, | |||
1724 | struct snd_soc_codec *codec = rtd->codec; | 1724 | struct snd_soc_codec *codec = rtd->codec; |
1725 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 1725 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
1726 | 1726 | ||
1727 | snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24); | ||
1727 | if (twl4030->master_substream) { | 1728 | if (twl4030->master_substream) { |
1728 | twl4030->slave_substream = substream; | 1729 | twl4030->slave_substream = substream; |
1729 | /* The DAI has one configuration for playback and capture, so | 1730 | /* The DAI has one configuration for playback and capture, so |
@@ -1848,7 +1849,7 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, | |||
1848 | case SNDRV_PCM_FORMAT_S16_LE: | 1849 | case SNDRV_PCM_FORMAT_S16_LE: |
1849 | format |= TWL4030_DATA_WIDTH_16S_16W; | 1850 | format |= TWL4030_DATA_WIDTH_16S_16W; |
1850 | break; | 1851 | break; |
1851 | case SNDRV_PCM_FORMAT_S24_LE: | 1852 | case SNDRV_PCM_FORMAT_S32_LE: |
1852 | format |= TWL4030_DATA_WIDTH_32S_24W; | 1853 | format |= TWL4030_DATA_WIDTH_32S_24W; |
1853 | break; | 1854 | break; |
1854 | default: | 1855 | default: |
@@ -2181,7 +2182,7 @@ static int twl4030_voice_set_tristate(struct snd_soc_dai *dai, int tristate) | |||
2181 | } | 2182 | } |
2182 | 2183 | ||
2183 | #define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000) | 2184 | #define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000) |
2184 | #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE) | 2185 | #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) |
2185 | 2186 | ||
2186 | static struct snd_soc_dai_ops twl4030_dai_hifi_ops = { | 2187 | static struct snd_soc_dai_ops twl4030_dai_hifi_ops = { |
2187 | .startup = twl4030_startup, | 2188 | .startup = twl4030_startup, |