Skip to content

Commit 4605327

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_micfil: Fix event generation in micfil_put_dc_remover_state()
[ Upstream commit 7d2bd35 ] ALSA controls should return 1 if the value in the control changed but the control put operation micfil_put_dc_remover_state() only returns 0 or a negative error code, causing ALSA to not generate any change events. return the value of snd_soc_component_update_bits() directly, as it has the capability of return check status of changed or not. 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: 29dbfee ("ASoC: fsl_micfil: Add Hardware Voice Activity Detector support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260401094226.2900532-6-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a6bc543 commit 4605327

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

sound/soc/fsl/fsl_micfil.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ static int micfil_put_dc_remover_state(struct snd_kcontrol *kcontrol,
243243
if (val < 0 || val > 3)
244244
return -EINVAL;
245245

246+
ret = pm_runtime_resume_and_get(comp->dev);
247+
if (ret)
248+
return ret;
249+
246250
micfil->dc_remover = val;
247251

248252
/* Calculate total value for all channels */
@@ -252,10 +256,10 @@ static int micfil_put_dc_remover_state(struct snd_kcontrol *kcontrol,
252256
/* Update DC Remover mode for all channels */
253257
ret = snd_soc_component_update_bits(comp, REG_MICFIL_DC_CTRL,
254258
MICFIL_DC_CTRL_CONFIG, reg_val);
255-
if (ret < 0)
256-
return ret;
257259

258-
return 0;
260+
pm_runtime_put_autosuspend(comp->dev);
261+
262+
return ret;
259263
}
260264

261265
static int micfil_get_dc_remover_state(struct snd_kcontrol *kcontrol,

0 commit comments

Comments
 (0)