]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ASoC: si476x: Add DAPM support
authorMark Brown <broonie@linaro.org>
Fri, 16 Aug 2013 10:54:51 +0000 (11:54 +0100)
committerMark Brown <broonie@linaro.org>
Sun, 18 Aug 2013 15:27:48 +0000 (16:27 +0100)
This ensures the driver continues to work with DAPM mandatory and makes
it easier to connect the device up to other components in the subsystem.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
sound/soc/codecs/si476x.c

index 73e205c892a0d087b4cfc8a6cd0a7de5c26873f3..38f3b105c17dc2da0809c903190dd37644f2508d 100644 (file)
@@ -102,6 +102,16 @@ static int si476x_codec_write(struct snd_soc_codec *codec,
        return err;
 }
 
+static const struct snd_soc_dapm_widget si476x_dapm_widgets[] = {
+SND_SOC_DAPM_OUTPUT("LOUT"),
+SND_SOC_DAPM_OUTPUT("ROUT"),
+};
+
+static const struct snd_soc_dapm_route si476x_dapm_routes[] = {
+       { "Capture", NULL, "LOUT" },
+       { "Capture", NULL, "ROUT" },
+};
+
 static int si476x_codec_set_dai_fmt(struct snd_soc_dai *codec_dai,
                                    unsigned int fmt)
 {
@@ -260,6 +270,10 @@ static struct snd_soc_codec_driver soc_codec_dev_si476x = {
        .probe  = si476x_codec_probe,
        .read   = si476x_codec_read,
        .write  = si476x_codec_write,
+       .dapm_widgets = si476x_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(si476x_dapm_widgets),
+       .dapm_routes = si476x_dapm_routes,
+       .num_dapm_routes = ARRAY_SIZE(si476x_dapm_routes),
 };
 
 static int si476x_platform_probe(struct platform_device *pdev)