Skip to content

Commit

Permalink
ASoC: arizona: Fix TDM slot length handling in arizona_hw_params
Browse files Browse the repository at this point in the history
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: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Nikesh Oswal authored and Mark Brown committed Aug 12, 2014
1 parent ae34a78 commit d114e5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/soc/codecs/arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,13 +1278,16 @@ 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);
bclk_target = tdm_slots * tdm_width * params_rate(params);
channels = tdm_slots;
} else {
bclk_target = snd_soc_params_to_bclk(params);
tdm_width = wl;
}

if (chan_limit && chan_limit < channels) {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit d114e5f

Please sign in to comment.