From df501989043a8e078dcce0fc3ac2dee34806d0f0 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Thu, 2 Mar 2023 09:22:13 +0800 Subject: [PATCH] ASoC: codecs: rk_dsm: fix channel disorder The dsm sound may be channel disorder when play sometimes, we can reset the rk_dsm to reconfigure the IP and make it work well. Signed-off-by: Jason Zhu Change-Id: Iece70267c478c0ec60f685ab85e39ff365b16f4c --- sound/soc/codecs/rk_dsm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/codecs/rk_dsm.c b/sound/soc/codecs/rk_dsm.c index 616014a7322f..8d9fabd970e7 100644 --- a/sound/soc/codecs/rk_dsm.c +++ b/sound/soc/codecs/rk_dsm.c @@ -385,6 +385,17 @@ static int rk_dsm_pcm_startup(struct snd_pcm_substream *substream, return 0; } +static void rk_dsm_reset(struct rk_dsm_priv *rd) +{ + if (IS_ERR(rd->rc)) + return; + + reset_control_assert(rd->rc); + udelay(5); + reset_control_deassert(rd->rc); + udelay(5); +} + static void rk_dsm_pcm_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { @@ -411,6 +422,8 @@ static void rk_dsm_pcm_shutdown(struct snd_pcm_substream *substream, DSM_DACDIGEN_DAC_GLBEN_DIS | DSM_DACDIGEN_DACEN_L0R1_DIS); } + + rk_dsm_reset(rd); } static const struct snd_soc_dai_ops rd_dai_ops = {