ASoC: dapm: Fix auto-disable for inverted controls
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 30 Aug 2013 15:39:33 +0000 (17:39 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 30 Aug 2013 15:41:06 +0000 (16:41 +0100)
We need to make sure that the control's cached value is initialized to the same
value as the control's widget->on_val. Otherwise updates might be lost.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-dapm.c

index 7e9afbc49ef2482d9418010e8e5bb854a92cfaba..13fcb61a922f5580d9eeb1d57fb0e16d0252ee79 100644 (file)
@@ -229,6 +229,8 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
                        template.id = snd_soc_dapm_kcontrol;
                        template.name = kcontrol->id.name;
 
+                       data->value = template.on_val;
+
                        data->widget = snd_soc_dapm_new_control(widget->dapm,
                                &template);
                        if (!data->widget) {