mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ASoC: wcd9310: Reset channel actual flag only if active
Resetting this channel actual flag without checking whether the set of channels are already in use, could cause failures in disconnecting those set of ports associated with that channels. Change-Id: If0b917023c8f6d11d6b5cd92708715e10a1408ab CRs-fixed: 384055 Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
This commit is contained in:
parent
4bf6321bd9
commit
21e5928043
1 changed files with 15 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue