Commit dcdeda4a60b2046dd18d3dd20cbd888f25d8916b
Committed by
Liam Girdwood
1 parent
a6cea9655b
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
sound/soc/codecs/twl4030.c
... | ... | @@ -1724,6 +1724,7 @@ |
1724 | 1724 | struct snd_soc_codec *codec = rtd->codec; |
1725 | 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 | 1728 | if (twl4030->master_substream) { |
1728 | 1729 | twl4030->slave_substream = substream; |
1729 | 1730 | /* The DAI has one configuration for playback and capture, so |
... | ... | @@ -1848,7 +1849,7 @@ |
1848 | 1849 | case SNDRV_PCM_FORMAT_S16_LE: |
1849 | 1850 | format |= TWL4030_DATA_WIDTH_16S_16W; |
1850 | 1851 | break; |
1851 | - case SNDRV_PCM_FORMAT_S24_LE: | |
1852 | + case SNDRV_PCM_FORMAT_S32_LE: | |
1852 | 1853 | format |= TWL4030_DATA_WIDTH_32S_24W; |
1853 | 1854 | break; |
1854 | 1855 | default: |
... | ... | @@ -2181,7 +2182,7 @@ |
2181 | 2182 | } |
2182 | 2183 | |
2183 | 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 | 2187 | static struct snd_soc_dai_ops twl4030_dai_hifi_ops = { |
2187 | 2188 | .startup = twl4030_startup, |