summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tas2770.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-21 12:37:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-21 12:37:10 +0300
commitd9c3b34d3b3af22d548007d5d36e83ad12140ee7 (patch)
tree2b721d41e444f5e50b1614601357ccaf447fd545 /sound/soc/codecs/tas2770.c
parentdd65a243a915ca319ed5fee9161a168c836fa2f2 (diff)
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8 (diff)
downloadlinux-d9c3b34d3b3af22d548007d5d36e83ad12140ee7.tar.xz
Merge 6.1-rc6 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/codecs/tas2770.c')
-rw-r--r--sound/soc/codecs/tas2770.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index b6765235a4b3..8557759acb1f 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -395,21 +395,13 @@ static int tas2770_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)