aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-04-20 15:27:09 +0100
committerMark Brown <broonie@kernel.org>2020-04-20 15:27:09 +0100
commitace105dd6159c7c4a49b4c80aa1efca31fc7720c (patch)
tree539e21f5565bd868e4d9f05c4ad242ca708e9d29 /sound/soc/soc-dapm.c
parentASoC: Intel: haswell: Power transition refactor (diff)
parentASoC: Fix wrong dependency of da7210 and wm8983 (diff)
downloadlinux-dev-ace105dd6159c7c4a49b4c80aa1efca31fc7720c.tar.xz
linux-dev-ace105dd6159c7c4a49b4c80aa1efca31fc7720c.zip
Merge series "ASoC: Fix dependency issues of SND_SOC" from Wei Li <liwei391@huawei.com>:
Fix dependency issues of SND_SOC introduced by commit ea00d95200d02 ("ASoC: Use imply for SND_SOC_ALL_CODECS"). Wei Li (2): ASoC: wm89xx: Fix build errors caused by I2C dependency ASoC: Fix wrong dependency of da7210 and wm8983 sound/soc/codecs/Kconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 5c7b1576d2a3..80658d13a855 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -423,7 +423,7 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
memset(&template, 0, sizeof(template));
template.reg = e->reg;
- template.mask = e->mask << e->shift_l;
+ template.mask = e->mask;
template.shift = e->shift_l;
template.off_val = snd_soc_enum_item_to_val(e, 0);
template.on_val = template.off_val;
@@ -546,8 +546,22 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
if (data->value == value)
return false;
- if (data->widget)
- data->widget->on_val = value;
+ if (data->widget) {
+ switch (dapm_kcontrol_get_wlist(kcontrol)->widgets[0]->id) {
+ case snd_soc_dapm_switch:
+ case snd_soc_dapm_mixer:
+ case snd_soc_dapm_mixer_named_ctl:
+ data->widget->on_val = value & data->widget->mask;
+ break;
+ case snd_soc_dapm_demux:
+ case snd_soc_dapm_mux:
+ data->widget->on_val = value >> data->widget->shift;
+ break;
+ default:
+ data->widget->on_val = value;
+ break;
+ }
+ }
data->value = value;