ASoC: hx4700: Automatically disconnect non-connected pins
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 9 Jan 2015 21:03:29 +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 ak4641 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/hx4700.c

index ce26551052a325eb7f8f496b6679d422db71e398..73eb5ddf9753beb405b7d64fae88ede40d57bab2 100644 (file)
@@ -127,15 +127,8 @@ static const struct snd_soc_dapm_route hx4700_audio_map[] = {
 static int hx4700_ak4641_init(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
        int err;
 
-       /* NC codec pins */
-       /* FIXME: is anything connected here? */
-       snd_soc_dapm_nc_pin(dapm, "MOUT1");
-       snd_soc_dapm_nc_pin(dapm, "MICEXT");
-       snd_soc_dapm_nc_pin(dapm, "AUX");
-
        /* Jack detection API stuff */
        err = snd_soc_jack_new(codec, "Headphone Jack",
                                SND_JACK_HEADPHONE, &hs_jack);
@@ -184,6 +177,7 @@ static struct snd_soc_card snd_soc_card_hx4700 = {
        .num_dapm_widgets       = ARRAY_SIZE(hx4700_dapm_widgets),
        .dapm_routes            = hx4700_audio_map,
        .num_dapm_routes        = ARRAY_SIZE(hx4700_audio_map),
+       .fully_routed           = true,
 };
 
 static struct gpio hx4700_audio_gpios[] = {