diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c index 571e71c72270..59cb45b30469 100644 --- a/sound/soc/codecs/wcd9310.c +++ b/sound/soc/codecs/wcd9310.c @@ -3878,11 +3878,22 @@ static int tabla_set_channel_map(struct snd_soc_dai *dai, } } else if (dai->id == AIF1_CAP || dai->id == AIF2_CAP || dai->id == AIF3_CAP) { - for (i = 0; i < tx_num; i++) { - tabla->dai[dai->id - 1].ch_num[i] = tx_slot[i]; - tabla->dai[dai->id - 1].ch_act = 0; - tabla->dai[dai->id - 1].ch_tot = tx_num; + tabla->dai[dai->id - 1].ch_tot = tx_num; + /* All channels are already active. + * do not reset ch_act flag + */ + if ((tabla->dai[dai->id - 1].ch_tot != 0) + && (tabla->dai[dai->id - 1].ch_act == + tabla->dai[dai->id - 1].ch_tot)) { + pr_info("%s: ch_act = %d, ch_tot = %d\n", __func__, + tabla->dai[dai->id - 1].ch_act, + tabla->dai[dai->id - 1].ch_tot); + return 0; } + + tabla->dai[dai->id - 1].ch_act = 0; + for (i = 0; i < tx_num; i++) + tabla->dai[dai->id - 1].ch_num[i] = tx_slot[i]; } return 0; }