ASoC: simple-amplifier: add VCC regulator widget
authorVasily Khoruzhick <anarsoul@gmail.com>
Thu, 22 Nov 2018 10:23:21 +0000 (18:23 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 23 Nov 2018 14:01:41 +0000 (14:01 +0000)
Amplifier may have assosicated regulator, so add a widget for it
and appropriate route.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/simple-amplifier.c

index 85524acf3e9cd2cdda5f56cec04a145c2bc99ade..c07e8a80b4b7dc99e5a31f352c9bebad023c2713 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
+#include <linux/regulator/consumer.h>
 #include <sound/soc.h>
 
 #define DRV_NAME "simple-amplifier"
@@ -58,11 +59,14 @@ static const struct snd_soc_dapm_widget simple_amp_dapm_widgets[] = {
                               (SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)),
        SND_SOC_DAPM_OUTPUT("OUTL"),
        SND_SOC_DAPM_OUTPUT("OUTR"),
+       SND_SOC_DAPM_REGULATOR_SUPPLY("VCC", 20, 0),
 };
 
 static const struct snd_soc_dapm_route simple_amp_dapm_routes[] = {
        { "DRV", NULL, "INL" },
        { "DRV", NULL, "INR" },
+       { "OUTL", NULL, "VCC" },
+       { "OUTR", NULL, "VCC" },
        { "OUTL", NULL, "DRV" },
        { "OUTR", NULL, "DRV" },
 };