Skip to content

Commit a431bf3

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_sai: replace regmap_write with regmap_update_bits
[ Upstream commit 0e270f3 ] Use the regmap_write() for software reset in fsl_sai_config_disable would cause the FSL_SAI_CSR_BCE bit to be cleared. Refer to commit 197c53c ("ASoC: fsl_sai: Don't disable bitclock for i.MX8MP") FSL_SAI_CSR_BCE should not be cleared. So need to use regmap_update_bits() instead of regmap_write() for these bit operations. Fixes: dc78f7e ("ASoC: fsl_sai: Force a software reset when starting in consumer mode") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20250807020318.2143219-1-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7fdc6ef commit a431bf3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sound/soc/fsl/fsl_sai.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,9 @@ static void fsl_sai_config_disable(struct fsl_sai *sai, int dir)
777777
* are running concurrently.
778778
*/
779779
/* Software Reset */
780-
regmap_write(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR);
780+
regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR);
781781
/* Clear SR bit to finish the reset */
782-
regmap_write(sai->regmap, FSL_SAI_xCSR(tx, ofs), 0);
782+
regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR, 0);
783783
}
784784

785785
static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
@@ -898,11 +898,11 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
898898
unsigned int ofs = sai->soc_data->reg_offset;
899899

900900
/* Software Reset for both Tx and Rx */
901-
regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR);
902-
regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR);
901+
regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR);
902+
regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR);
903903
/* Clear SR bit to finish the reset */
904-
regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0);
905-
regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
904+
regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, 0);
905+
regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, 0);
906906

907907
regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs),
908908
FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
@@ -1785,11 +1785,11 @@ static int fsl_sai_runtime_resume(struct device *dev)
17851785

17861786
regcache_cache_only(sai->regmap, false);
17871787
regcache_mark_dirty(sai->regmap);
1788-
regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR);
1789-
regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR);
1788+
regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR);
1789+
regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR);
17901790
usleep_range(1000, 2000);
1791-
regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0);
1792-
regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
1791+
regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, 0);
1792+
regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, 0);
17931793

17941794
ret = regcache_sync(sai->regmap);
17951795
if (ret)

0 commit comments

Comments
 (0)