From a2be2f002ea3b391df3bf2e415f0c11e2380f959 Mon Sep 17 00:00:00 2001 From: Xing Zheng Date: Mon, 28 Apr 2025 10:03:36 +0800 Subject: [PATCH] ASoC: codecs: rk_dsm: Fixed the configuration in multi codec sound was modified by capture stream Also, the setting of rk_dsm_set_clk() is only in the playback stream. Signed-off-by: Xing Zheng Change-Id: I142091151f94cc62b4b22f4079d3ab03f9dce57f --- sound/soc/codecs/rk_dsm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rk_dsm.c b/sound/soc/codecs/rk_dsm.c index 07e3793ae51b..b6b4348f3863 100644 --- a/sound/soc/codecs/rk_dsm.c +++ b/sound/soc/codecs/rk_dsm.c @@ -380,9 +380,9 @@ static int rk_dsm_hw_params(struct snd_pcm_substream *substream, snd_soc_component_get_drvdata(dai->component); unsigned int srt = 0, val = 0; - rk_dsm_set_clk(rd, substream, params_rate(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + rk_dsm_set_clk(rd, substream, params_rate(params)); + switch (params_rate(params)) { case 8000: case 11025: @@ -460,6 +460,9 @@ static int rk_dsm_pcm_startup(struct snd_pcm_substream *substream, struct rk_dsm_priv *rd = snd_soc_component_get_drvdata(dai->component); + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + return 0; + /* Recover DAC Volumes */ regmap_write(rd->regmap, DACVOLL0, rd->vols.vol_l); regmap_write(rd->regmap, DACVOLR0, rd->vols.vol_r); @@ -489,6 +492,9 @@ static void rk_dsm_pcm_shutdown(struct snd_pcm_substream *substream, struct rk_dsm_priv *rd = snd_soc_component_get_drvdata(dai->component); + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + return; + gpiod_set_value(rd->pa_ctl, 0); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { @@ -519,6 +525,9 @@ static int rk_dsm_pcm_trigger(struct snd_pcm_substream *substream, struct rk_dsm_priv *rd = snd_soc_component_get_drvdata(dai->component); + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + return 0; + switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: