* [PATCH] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP
@ 2023-12-18 9:28 Shengjiu Wang
2023-12-18 10:11 ` Fabio Estevam
0 siblings, 1 reply; 2+ messages in thread
From: Shengjiu Wang @ 2023-12-18 9:28 UTC (permalink / raw)
To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
broonie, perex, tiwai, alsa-devel, linuxppc-dev, linux-kernel,
linux-sound
When flag mclk_with_tere and mclk_direction_output enabled,
The SAI transmitter or receiver will be enabled in very early
stage, that if FSL_SAI_xMR is set by previous case,
for example previous case is one channel, current case is
two channels, then current case started with wrong xMR in
the beginning, then channel swap happen.
The patch is to clear xMR in hw_free() to avoid such
channel swap issue.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_sai.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 32bbe5056a63..546bd4e333b5 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -714,6 +714,9 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream,
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
unsigned int ofs = sai->soc_data->reg_offset;
+ /* Clear xMR to avoid channel swap with mclk_with_tere enabled case */
+ regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0);
+
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs),
FSL_SAI_CR3_TRCE_MASK, 0);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP
2023-12-18 9:28 [PATCH] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP Shengjiu Wang
@ 2023-12-18 10:11 ` Fabio Estevam
0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2023-12-18 10:11 UTC (permalink / raw)
To: Shengjiu Wang
Cc: shengjiu.wang, Xiubo.Lee, nicoleotsuka, lgirdwood, broonie,
perex, tiwai, alsa-devel, linuxppc-dev, linux-kernel,
linux-sound
On Mon, Dec 18, 2023 at 7:10 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> When flag mclk_with_tere and mclk_direction_output enabled,
> The SAI transmitter or receiver will be enabled in very early
> stage, that if FSL_SAI_xMR is set by previous case,
> for example previous case is one channel, current case is
> two channels, then current case started with wrong xMR in
> the beginning, then channel swap happen.
>
> The patch is to clear xMR in hw_free() to avoid such
> channel swap issue.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Fixes tag, please.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-18 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-18 9:28 [PATCH] ASoC: fsl_sai: Fix channel swap issue on i.MX8MP Shengjiu Wang
2023-12-18 10:11 ` Fabio Estevam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®