[ALSA] soc - Fix power switching support for DAPM_SWITCH widgets
authorMilan plzik <milan.plzik@gmail.com>
Thu, 10 Jan 2008 13:39:46 +0000 (14:39 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:29:50 +0000 (17:29 +0100)
Signed-off-by: Milan plzik <milan.plzik@gmail.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/soc-dapm.c

index 7eb6c5c0377540ab92cff5cad61cb7575faa5f27..91d58b56470eebb2fa3a561f8d11f255a0ed0d22 100644 (file)
@@ -691,7 +691,7 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
        return 0;
 }
 
-/* test and update the power status of a mixer widget */
+/* test and update the power status of a mixer or switch widget */
 static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
                                   struct snd_kcontrol *kcontrol, int reg,
                                   int val_mask, int val, int invert)
@@ -699,7 +699,8 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
        struct snd_soc_dapm_path *path;
        int found = 0;
 
-       if (widget->id != snd_soc_dapm_mixer)
+       if (widget->id != snd_soc_dapm_mixer &&
+           widget->id != snd_soc_dapm_switch)
                return -ENODEV;
 
        if (!snd_soc_test_bits(widget->codec, reg, val_mask, val))