Skip to contentSkip to conversation

ASoC: arizona: Fix TDM slot length handling in arizona_hw_params

PATCH Applied Charles Keepax 2 participants 2 messages Aug 12, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: arizona: Fix TDM slot length handling in arizona_hw_params

From: Nikesh Oswal <[email protected]>

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

---
 sound/soc/codecs/arizona.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/arizona.c +4 -2
index 2f2e91a..4dfab95 100644
@@ -1278,6 +1278,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
 	else
 		rates = &arizona_48k_bclk_rates[0];
 
+	wl = snd_pcm_format_width(params_format(params));
+
 	if (tdm_slots) {
 		arizona_aif_dbg(dai, "Configuring for %d %d bit TDM slots\n",
 				tdm_slots, tdm_width);
@@ -1285,6 +1287,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
 		channels = tdm_slots;
 	} else {
 		bclk_target = snd_soc_params_to_bclk(params);
+		tdm_width = wl;
 	}
 
 	if (chan_limit && chan_limit < channels) {
@@ -1319,8 +1322,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
 	arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n",
 			rates[bclk], rates[bclk] / lrclk);
 
-	wl = snd_pcm_format_width(params_format(params));
-	frame = wl << ARIZONA_AIF1TX_WL_SHIFT | wl;
+	frame = wl << ARIZONA_AIF1TX_WL_SHIFT | tdm_width;
 
 	reconfig = arizona_aif_cfg_changed(codec, base, bclk, lrclk, frame);
 
Signature · 1 line
1.7.2.5
maintainer Applied
#1 lore raw
Quoted 5 lines · Charles Keepax

From: Nikesh Oswal <[email protected]>

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

Applied, thanks.