Skip to content

Commit 980555e

Browse files
charleskeepaxbroonie
authored andcommitted
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: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e3cabbe commit 980555e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/soc/codecs/madera.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
899899
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
900900
const int adsp_num = e->shift_l;
901901
const unsigned int item = ucontrol->value.enumerated.item[0];
902-
int ret;
902+
int ret = 0;
903903

904904
if (item >= e->items)
905905
return -EINVAL;
@@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
916916
"Cannot change '%s' while in use by active audio paths\n",
917917
kcontrol->id.name);
918918
ret = -EBUSY;
919-
} else {
919+
} else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) {
920920
/* Volatile register so defer until the codec is powered up */
921921
priv->adsp_rate_cache[adsp_num] = e->values[item];
922-
ret = 0;
922+
ret = 1;
923923
}
924924

925925
mutex_unlock(&priv->rate_lock);

0 commit comments

Comments
 (0)