From: Shengjiu Wang <shengjiu.wang@nxp.com>
To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] ASoC: fsl_micfil: Fix event generation in micfil_range_set()
Date: Mon, 30 Mar 2026 19:25:48 +0800 [thread overview]
Message-ID: <20260330112555.3637002-5-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <20260330112555.3637002-1-shengjiu.wang@nxp.com>
ALSA controls should return 1 if the value in the control changed but the
control put operation micfil_range_set() only returns 0 or a negative
error code, causing ALSA to not generate any change events.
Use snd_soc_component_update_bits() function to replace the
regmap_update_bits(), for snd_soc_component_update_bits() has the
capability of return check status.
Also enable pm runtime before calling the function
snd_soc_component_update_bits() to make the regmap cache data align with
the value in hardware.
Fixes: ef1a7e02fdb7 ("ASoC: fsl_micfil: Set channel range control")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/fsl_micfil.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c
index 1c826e0cb1d5..0cfdd6343291 100644
--- a/sound/soc/fsl/fsl_micfil.c
+++ b/sound/soc/fsl/fsl_micfil.c
@@ -210,15 +210,23 @@ static int micfil_range_set(struct snd_kcontrol *kcontrol,
(struct soc_mixer_control *)kcontrol->private_value;
unsigned int shift = mc->shift;
int max_range, new_range;
+ int ret;
new_range = ucontrol->value.integer.value[0];
max_range = micfil_get_max_range(micfil);
if (new_range > max_range)
dev_warn(&micfil->pdev->dev, "range makes channel %d data unreliable\n", shift / 4);
- regmap_update_bits(micfil->regmap, REG_MICFIL_OUT_CTRL, 0xF << shift, new_range << shift);
+ ret = pm_runtime_resume_and_get(cmpnt->dev);
+ if (ret)
+ return ret;
- return 0;
+ ret = snd_soc_component_update_bits(cmpnt, REG_MICFIL_OUT_CTRL, 0xF << shift,
+ new_range << shift);
+
+ pm_runtime_put_autosuspend(cmpnt->dev);
+
+ return ret;
}
static int micfil_set_quality(struct fsl_micfil *micfil)
--
2.34.1
next prev parent reply other threads:[~2026-03-30 11:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 11:25 [PATCH 00/11] ASoC: fsl: fix mixer-test failures Shengjiu Wang
2026-03-30 11:25 ` [PATCH 01/11] ASoC: fsl_micfil: Add access property for "VAD Detected" Shengjiu Wang
2026-03-30 11:25 ` [PATCH 02/11] ASoC: fsl_micfil: Fix event generation in hwvad_put_enable() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 03/11] ASoC: fsl_micfil: Fix event generation in hwvad_put_init_mode() Shengjiu Wang
2026-03-30 11:25 ` Shengjiu Wang [this message]
2026-03-30 11:25 ` [PATCH 05/11] ASoC: fsl_micfil: Fix event generation in micfil_put_dc_remover_state() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 06/11] ASoC: fsl_micfil: Fix event generation in micfil_quality_set() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 07/11] ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_arc_mode_put() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 08/11] ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_mode_put() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 09/11] ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 10/11] ASoC: fsl_easrc: Fix value type in fsl_easrc_iec958_get_bits() Shengjiu Wang
2026-03-30 11:25 ` [PATCH 11/11] ASoC: fsl_easrc: Change the type for iec958 channel status controls Shengjiu Wang
2026-03-30 13:23 ` Mark Brown
2026-03-31 1:58 ` Shengjiu Wang
2026-03-31 13:19 ` Mark Brown
2026-03-31 13:50 ` Shengjiu Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260330112555.3637002-5-shengjiu.wang@nxp.com \
--to=shengjiu.wang@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox