mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ASoC: rockchip: i2s-tdm: try normal clear before switch master mode
As mind by sugar, sometimes the master device will exit unexpectly, stop
the sclk before the slave device to do stop trigger, for example the bt
module, which not act as a codec driver, is replaced by a dummy codec.
This patch adds a normal clear for i2s tdm before force switch to
master.
Fixes: c003b7fd8a ("ASoC: rockchip: i2s-tdm: Fix FIFO Clear failed on SLAVE mode sometimes")
Change-Id: Ia3ae2d9b008b07addcfcec38d4e970c376dae1e7
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
@@ -397,6 +397,12 @@ static int rockchip_i2s_tdm_clear(struct rk_i2s_tdm_dev *i2s_tdm,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s_tdm->regmap, I2S_CLR, clr, clr);
|
||||
ret = regmap_read_poll_timeout_atomic(i2s_tdm->regmap, I2S_CLR, val,
|
||||
!(val & clr), 10, 100);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Workaround for FIFO clear on SLAVE mode:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user