Skip to content

Commit

Permalink
ASoC: rockchip: i2s: use regmap_read_poll_timeout_atomic to poll I2S_CLR
Browse files Browse the repository at this point in the history
[ Upstream commit f0c8d74 ]

1. Uses regmap_read_poll_timeout_atomic to poll I2S_CLR as it is called
   within a spin lock.

2. Fixes the typo of break condition in regmap_read_poll_timeout_atomic.

Fixes: fbb0ec6 ("ASoC: rockchip: i2s: use regmap_read_poll_timeout to poll I2S_CLR")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20220930151546.2017667-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Judy Hsiao authored and gregkh committed Oct 21, 2022
1 parent c218130 commit bffdf4d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions sound/soc/rockchip/rockchip_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ static int rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
I2S_CLR_TXC | I2S_CLR_RXC);
if (ret < 0)
goto end;
ret = regmap_read_poll_timeout(i2s->regmap,
I2S_CLR,
val,
val != 0,
20,
200);
ret = regmap_read_poll_timeout_atomic(i2s->regmap,
I2S_CLR,
val,
val == 0,
20,
200);
if (ret < 0)
dev_warn(i2s->dev, "fail to clear: %d\n", ret);
}
Expand Down Expand Up @@ -220,12 +220,12 @@ static int rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
I2S_CLR_TXC | I2S_CLR_RXC);
if (ret < 0)
goto end;
ret = regmap_read_poll_timeout(i2s->regmap,
I2S_CLR,
val,
val != 0,
20,
200);
ret = regmap_read_poll_timeout_atomic(i2s->regmap,
I2S_CLR,
val,
val == 0,
20,
200);
if (ret < 0)
dev_warn(i2s->dev, "fail to clear: %d\n", ret);
}
Expand Down

0 comments on commit bffdf4d

Please sign in to comment.