Skip to content

Commit 5026dc4

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_xcvr: Fix event generation in fsl_xcvr_arc_mode_put()
[ Upstream commit 1b61c81 ] ALSA controls should return 1 if the value in the control changed but the control put operation fsl_xcvr_arc_mode_put() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the arc_mode variable. Fixes: 2856448 ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260401094226.2900532-8-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ba04af0 commit 5026dc4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sound/soc/fsl/fsl_xcvr.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,17 @@ static int fsl_xcvr_arc_mode_put(struct snd_kcontrol *kcontrol,
115115
struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai);
116116
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
117117
unsigned int *item = ucontrol->value.enumerated.item;
118+
int val = snd_soc_enum_item_to_val(e, item[0]);
119+
int ret;
118120

119-
xcvr->arc_mode = snd_soc_enum_item_to_val(e, item[0]);
121+
if (val < 0 || val > 1)
122+
return -EINVAL;
120123

121-
return 0;
124+
ret = (xcvr->arc_mode != val);
125+
126+
xcvr->arc_mode = val;
127+
128+
return ret;
122129
}
123130

124131
static int fsl_xcvr_arc_mode_get(struct snd_kcontrol *kcontrol,

0 commit comments

Comments
 (0)