Commit 18f51ed0 authored by Mark Brown's avatar Mark Brown

ASoC: mt8183: Fix event generation for I2S DAI operations

ALSA control put() operations should return 0 if the value changed so that
events can be generated appropriately for userspace but the custom control
in the MT8183 I2S DAI driver doesn't do that, fix it.
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt8183-quick-fixes-v1-2-041f29419ed5@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d71ed1c8
...@@ -141,7 +141,7 @@ static int mt8183_i2s_hd_set(struct snd_kcontrol *kcontrol, ...@@ -141,7 +141,7 @@ static int mt8183_i2s_hd_set(struct snd_kcontrol *kcontrol,
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mtk_afe_i2s_priv *i2s_priv; struct mtk_afe_i2s_priv *i2s_priv;
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
int hd_en; int hd_en, change;
if (ucontrol->value.enumerated.item[0] >= e->items) if (ucontrol->value.enumerated.item[0] >= e->items)
return -EINVAL; return -EINVAL;
...@@ -155,9 +155,10 @@ static int mt8183_i2s_hd_set(struct snd_kcontrol *kcontrol, ...@@ -155,9 +155,10 @@ static int mt8183_i2s_hd_set(struct snd_kcontrol *kcontrol,
return -EINVAL; return -EINVAL;
} }
change = i2s_priv->low_jitter_en != hd_en;
i2s_priv->low_jitter_en = hd_en; i2s_priv->low_jitter_en = hd_en;
return 0; return change;
} }
static const struct snd_kcontrol_new mtk_dai_i2s_controls[] = { static const struct snd_kcontrol_new mtk_dai_i2s_controls[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment