ASoC: rockchip: i2s-tdm: Optimize TRCM on slave mode

TRCM require TX/RX enabled at the same time, or need the one
which provide clk enabled at first for master mode.

It is quite a different for slave mode which does not have
these restrictions, because the BCLK / LRCK are provided by
external master devices.

So, we just set the right clk path value on TRCM register on
stage probe and then drop the trcm value to make TX / RX work
independently.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I104f168d75787d79625ca7765a1bda1e77cdde12
This commit is contained in:
Sugar Zhang 2023-05-23 16:38:33 +08:00
parent 99bdd6ef7d
commit 823316b64b
1 changed files with 13 additions and 0 deletions

View File

@ -655,6 +655,19 @@ static int rockchip_i2s_tdm_set_fmt(struct snd_soc_dai *cpu_dai,
case SND_SOC_DAIFMT_CBM_CFM:
val = I2S_CKR_MSS_SLAVE;
i2s_tdm->is_master_mode = false;
/*
* TRCM require TX/RX enabled at the same time, or need the one
* which provide clk enabled at first for master mode.
*
* It is quite a different for slave mode which does not have
* these restrictions, because the BCLK / LRCK are provided by
* external master devices.
*
* So, we just set the right clk path value on TRCM register on
* stage probe and then drop the trcm value to make TX / RX work
* independently.
*/
i2s_tdm->clk_trcm = 0;
break;
default:
ret = -EINVAL;