Skip to content

Commit 2cff2e5

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 a839898 commit 2cff2e5

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
@@ -108,10 +108,17 @@ static int fsl_xcvr_arc_mode_put(struct snd_kcontrol *kcontrol,
108108
struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai);
109109
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
110110
unsigned int *item = ucontrol->value.enumerated.item;
111+
int val = snd_soc_enum_item_to_val(e, item[0]);
112+
int ret;
111113

112-
xcvr->arc_mode = snd_soc_enum_item_to_val(e, item[0]);
114+
if (val < 0 || val > 1)
115+
return -EINVAL;
113116

114-
return 0;
117+
ret = (xcvr->arc_mode != val);
118+
119+
xcvr->arc_mode = val;
120+
121+
return ret;
115122
}
116123

117124
static int fsl_xcvr_arc_mode_get(struct snd_kcontrol *kcontrol,

0 commit comments

Comments
 (0)