未验证 提交 980555e9 编写于 作者: C Charles Keepax 提交者: Mark Brown

ASoC: madera: Fix event generation for rate controls

madera_adsp_rate_put always returns zero regardless of if the control
value was updated. This results in missing notifications to user-space
of the control change. Update the handling to return 1 when the
value is changed.
Signed-off-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623105120.1981154-5-ckeepax@opensource.cirrus.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 e3cabbef
...@@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, ...@@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
const int adsp_num = e->shift_l; const int adsp_num = e->shift_l;
const unsigned int item = ucontrol->value.enumerated.item[0]; const unsigned int item = ucontrol->value.enumerated.item[0];
int ret; int ret = 0;
if (item >= e->items) if (item >= e->items)
return -EINVAL; return -EINVAL;
...@@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, ...@@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
"Cannot change '%s' while in use by active audio paths\n", "Cannot change '%s' while in use by active audio paths\n",
kcontrol->id.name); kcontrol->id.name);
ret = -EBUSY; ret = -EBUSY;
} else { } else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) {
/* Volatile register so defer until the codec is powered up */ /* Volatile register so defer until the codec is powered up */
priv->adsp_rate_cache[adsp_num] = e->values[item]; priv->adsp_rate_cache[adsp_num] = e->values[item];
ret = 0; ret = 1;
} }
mutex_unlock(&priv->rate_lock); mutex_unlock(&priv->rate_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册