Commit d114e5f7 authored by Nikesh Oswal's avatar Nikesh Oswal Committed by Mark Brown

ASoC: arizona: Fix TDM slot length handling in arizona_hw_params

TDM slot length was set same as word length, regardless of the value
received in set_tdm_slot. This patch sets the TDM slot length correctly
as received in set_tdm_slot DAI callback
Signed-off-by: default avatarNikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent ae34a78c
...@@ -1278,6 +1278,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, ...@@ -1278,6 +1278,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
else else
rates = &arizona_48k_bclk_rates[0]; rates = &arizona_48k_bclk_rates[0];
wl = snd_pcm_format_width(params_format(params));
if (tdm_slots) { if (tdm_slots) {
arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n", arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n",
tdm_slots, tdm_width); tdm_slots, tdm_width);
...@@ -1285,6 +1287,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, ...@@ -1285,6 +1287,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
channels = tdm_slots; channels = tdm_slots;
} else { } else {
bclk_target = snd_soc_params_to_bclk(params); bclk_target = snd_soc_params_to_bclk(params);
tdm_width = wl;
} }
if (chan_limit && chan_limit < channels) { if (chan_limit && chan_limit < channels) {
...@@ -1319,8 +1322,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream, ...@@ -1319,8 +1322,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n", arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n",
rates[bclk], rates[bclk] / lrclk); rates[bclk], rates[bclk] / lrclk);
wl = snd_pcm_format_width(params_format(params)); frame = wl << ARIZONA_AIF1TX_WL_SHIFT | tdm_width;
frame = wl << ARIZONA_AIF1TX_WL_SHIFT | wl;
reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame); reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame);
......
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