ASoC: wm8782: Add DAPM support
authorMark Brown <broonie@linaro.org>
Sun, 18 Aug 2013 17:36:06 +0000 (18:36 +0100)
committerMark Brown <broonie@linaro.org>
Sun, 18 Aug 2013 17:39:49 +0000 (18:39 +0100)
In order to make the device easier to hook up to external components in
system designs and ensure operation when DAPM support becomes mandatory
add DAPM support.

Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/wm8782.c

index f1fdbf63abb4f41e4e8c1a69b92e1357f3d6df00..8092495605ce3ff147c762d452963f2d8f41c3b8 100644 (file)
 #include <sound/initval.h>
 #include <sound/soc.h>
 
+static const struct snd_soc_dapm_widget wm8782_dapm_widgets[] = {
+SND_SOC_DAPM_INPUT("AINL"),
+SND_SOC_DAPM_INPUT("AINR"),
+};
+
+static const struct snd_soc_dapm_route wm8782_dapm_routes[] = {
+       { "Capture", NULL, "AINL" },
+       { "Capture", NULL, "AINR" },
+};
+
 static struct snd_soc_dai_driver wm8782_dai = {
        .name = "wm8782",
        .capture = {
@@ -40,7 +50,12 @@ static struct snd_soc_dai_driver wm8782_dai = {
        },
 };
 
-static struct snd_soc_codec_driver soc_codec_dev_wm8782;
+static struct snd_soc_codec_driver soc_codec_dev_wm8782 = {
+       .dapm_widgets = wm8782_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(wm8782_dapm_widgets),
+       .dapm_routes = wm8782_dapm_routes,
+       .num_dapm_routes = ARRAY_SIZE(wm8782_dapm_routes),
+};
 
 static int wm8782_probe(struct platform_device *pdev)
 {