ASoC: spitz: Automatically disconnect non-connected pins
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 9 Jan 2015 21:03:33 +0000 (22:03 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 9 Jan 2015 21:05:55 +0000 (21:05 +0000)
All DAPM input and output pins of the wm8750 are either used in the card's
DAPM routing table or are marked as not connected.

Set the fully_routed flag of the card instead of manually marking the unused
inputs and outputs as not connected. This makes the code a bit shorter and
cleaner.

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

index a6d680acd907ebd1e72c62d0c0e0d8969153645d..461123ad5ff2d4c56e21a97a14e27f8ce7d841c4 100644 (file)
@@ -256,26 +256,6 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = {
                spitz_set_spk),
 };
 
-/*
- * Logic for a wm8750 as connected on a Sharp SL-Cxx00 Device
- */
-static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd)
-{
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       /* NC codec pins */
-       snd_soc_dapm_nc_pin(dapm, "RINPUT1");
-       snd_soc_dapm_nc_pin(dapm, "LINPUT2");
-       snd_soc_dapm_nc_pin(dapm, "RINPUT2");
-       snd_soc_dapm_nc_pin(dapm, "LINPUT3");
-       snd_soc_dapm_nc_pin(dapm, "RINPUT3");
-       snd_soc_dapm_nc_pin(dapm, "OUT3");
-       snd_soc_dapm_nc_pin(dapm, "MONO1");
-
-       return 0;
-}
-
 /* spitz digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link spitz_dai = {
        .name = "wm8750",
@@ -284,7 +264,6 @@ static struct snd_soc_dai_link spitz_dai = {
        .codec_dai_name = "wm8750-hifi",
        .platform_name = "pxa-pcm-audio",
        .codec_name = "wm8750.0-001b",
-       .init = spitz_wm8750_init,
        .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
                   SND_SOC_DAIFMT_CBS_CFS,
        .ops = &spitz_ops,
@@ -303,6 +282,7 @@ static struct snd_soc_card snd_soc_spitz = {
        .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
        .dapm_routes = spitz_audio_map,
        .num_dapm_routes = ARRAY_SIZE(spitz_audio_map),
+       .fully_routed = true,
 };
 
 static int spitz_probe(struct platform_device *pdev)