ASoC: rockchip: sai: Fix the slot mask bitmap

The tx and rx masks use a 1 bit for an active slot as default,
and the default active bits are at the LSB of the masks.

The explicit masks are given as array of integers, where the first
number presents bit-0 (LSB), second presents bit-1, etc. Any non zero
number is considered 1 and 0 is 0.

So, we need do a XOR to get the masked bitmap.

Fixes: e0d4c336d2 ("ASoC: rockchip: sai: Add support for slot mask cfg")

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7f9baea58a4f6bea3e99f97ef9161ac94152a6f5
This commit is contained in:
Sugar Zhang
2025-04-08 19:39:51 +08:00
committed by Tao Huang
parent c8d8af684e
commit c40224f930

View File

@@ -1081,6 +1081,9 @@ static int rockchip_sai_set_tdm_slot(struct snd_soc_dai *dai,
{
struct rk_sai_dev *sai = snd_soc_dai_get_drvdata(dai);
tx_mask ^= (BIT(slots) - 1);
rx_mask ^= (BIT(slots) - 1);
pm_runtime_get_sync(dai->dev);
regmap_update_bits(sai->regmap, SAI_TXCR, SAI_XCR_SBW_MASK,
SAI_XCR_SBW(slot_width));