diff options
author | Mark Brown <broonie@kernel.org> | 2022-11-29 15:55:12 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-11-29 15:55:51 +0300 |
commit | aeb2e9c4eedc6fed264a51ca2ea17c83984d2a64 (patch) | |
tree | 3d80758082c0a3bc293761cc1a4cbac2e457b128 /sound/soc/codecs/tas2780.c | |
parent | 863b9179cee4570e5da4206dcf8dbcdcc37c8348 (diff) | |
parent | 3d1bb6cc1a654c8693a85b1d262e610196edec8b (diff) | |
download | linux-aeb2e9c4eedc6fed264a51ca2ea17c83984d2a64.tar.xz |
ASoC: Merge up fixes
Merge the fixes branch up so we can apply further AMD work.
Diffstat (limited to 'sound/soc/codecs/tas2780.c')
-rw-r--r-- | sound/soc/codecs/tas2780.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sound/soc/codecs/tas2780.c b/sound/soc/codecs/tas2780.c index 9e3108fd3519..09e7ada1bca4 100644 --- a/sound/soc/codecs/tas2780.c +++ b/sound/soc/codecs/tas2780.c @@ -380,20 +380,13 @@ static int tas2780_set_dai_tdm_slot(struct snd_soc_dai *dai, if (tx_mask == 0 || rx_mask != 0) return -EINVAL; - if (slots == 1) { - if (tx_mask != 1) - return -EINVAL; - left_slot = 0; - right_slot = 0; + left_slot = __ffs(tx_mask); + tx_mask &= ~(1 << left_slot); + if (tx_mask == 0) { + right_slot = left_slot; } else { - left_slot = __ffs(tx_mask); - tx_mask &= ~(1 << left_slot); - if (tx_mask == 0) { - right_slot = left_slot; - } else { - right_slot = __ffs(tx_mask); - tx_mask &= ~(1 << right_slot); - } + right_slot = __ffs(tx_mask); + tx_mask &= ~(1 << right_slot); } if (tx_mask != 0 || left_slot >= slots || right_slot >= slots) |