Commit 10e7ff00 authored by Mark Brown's avatar Mark Brown

ASoC: wcd938x: Fix event generation for some controls

Currently wcd938x_*_put() unconditionally report that the value of the
control changed, resulting in spurious events being generated. Return 0 in
that case instead as we should. There is still an issue in the compander
control which is a bit more complex.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20220603122526.3914942-1-broonie@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a7786cba
...@@ -2519,6 +2519,9 @@ static int wcd938x_tx_mode_put(struct snd_kcontrol *kcontrol, ...@@ -2519,6 +2519,9 @@ static int wcd938x_tx_mode_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;
int path = e->shift_l; int path = e->shift_l;
if (wcd938x->tx_mode[path] == ucontrol->value.enumerated.item[0])
return 0;
wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0]; wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0];
return 1; return 1;
...@@ -2541,6 +2544,9 @@ static int wcd938x_rx_hph_mode_put(struct snd_kcontrol *kcontrol, ...@@ -2541,6 +2544,9 @@ static int wcd938x_rx_hph_mode_put(struct snd_kcontrol *kcontrol,
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
if (wcd938x->hph_mode == ucontrol->value.enumerated.item[0])
return 0;
wcd938x->hph_mode = ucontrol->value.enumerated.item[0]; wcd938x->hph_mode = ucontrol->value.enumerated.item[0];
return 1; return 1;
...@@ -2632,6 +2638,9 @@ static int wcd938x_ldoh_put(struct snd_kcontrol *kcontrol, ...@@ -2632,6 +2638,9 @@ static int wcd938x_ldoh_put(struct snd_kcontrol *kcontrol,
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
if (wcd938x->ldoh == ucontrol->value.integer.value[0])
return 0;
wcd938x->ldoh = ucontrol->value.integer.value[0]; wcd938x->ldoh = ucontrol->value.integer.value[0];
return 1; return 1;
...@@ -2654,6 +2663,9 @@ static int wcd938x_bcs_put(struct snd_kcontrol *kcontrol, ...@@ -2654,6 +2663,9 @@ static int wcd938x_bcs_put(struct snd_kcontrol *kcontrol,
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
if (wcd938x->bcs_dis == ucontrol->value.integer.value[0])
return 0;
wcd938x->bcs_dis = ucontrol->value.integer.value[0]; wcd938x->bcs_dis = ucontrol->value.integer.value[0];
return 1; return 1;
......
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