aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-04-11 05:18:43 -0400
committerMark Brown <broonie@kernel.org>2015-04-27 10:39:23 -0400
commita1677e3902a9a8a060728331063dd6ee999764fa (patch)
treecb003a8c47e5304778aa1dab39925c61535abc06 /sound/soc/atmel
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
According to the schematics the both LHPOUT and RHPOUT are connected to the external connector. RHPOUT is missing from the DAPM routes, but otherwise they seem to be complete. This patch adds the missing route and then sets the fully_routed flag for the card. This allows to remove all the manual calls to snd_soc_dapm_nc_pin(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r--sound/soc/atmel/sam9g20_wm8731.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 8de836165cf2..d7469cdd90dc 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -95,8 +95,9 @@ static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = {
95 95
96static const struct snd_soc_dapm_route intercon[] = { 96static const struct snd_soc_dapm_route intercon[] = {
97 97
98 /* speaker connected to LHPOUT */ 98 /* speaker connected to LHPOUT/RHPOUT */
99 {"Ext Spk", NULL, "LHPOUT"}, 99 {"Ext Spk", NULL, "LHPOUT"},
100 {"Ext Spk", NULL, "RHPOUT"},
100 101
101 /* mic is connected to Mic Jack, with WM8731 Mic Bias */ 102 /* mic is connected to Mic Jack, with WM8731 Mic Bias */
102 {"MICIN", NULL, "Mic Bias"}, 103 {"MICIN", NULL, "Mic Bias"},
@@ -108,9 +109,7 @@ static const struct snd_soc_dapm_route intercon[] = {
108 */ 109 */
109static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd) 110static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
110{ 111{
111 struct snd_soc_codec *codec = rtd->codec;
112 struct snd_soc_dai *codec_dai = rtd->codec_dai; 112 struct snd_soc_dai *codec_dai = rtd->codec_dai;
113 struct snd_soc_dapm_context *dapm = &codec->dapm;
114 int ret; 113 int ret;
115 114
116 printk(KERN_DEBUG 115 printk(KERN_DEBUG
@@ -124,10 +123,6 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
124 return ret; 123 return ret;
125 } 124 }
126 125
127 /* not connected */
128 snd_soc_dapm_nc_pin(dapm, "RLINEIN");
129 snd_soc_dapm_nc_pin(dapm, "LLINEIN");
130
131#ifndef ENABLE_MIC_INPUT 126#ifndef ENABLE_MIC_INPUT
132 snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic"); 127 snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
133#endif 128#endif
@@ -158,6 +153,7 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
158 .num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets), 153 .num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
159 .dapm_routes = intercon, 154 .dapm_routes = intercon,
160 .num_dapm_routes = ARRAY_SIZE(intercon), 155 .num_dapm_routes = ARRAY_SIZE(intercon),
156 .fully_routed = true,
161}; 157};
162 158
163static int at91sam9g20ek_audio_probe(struct platform_device *pdev) 159static int at91sam9g20ek_audio_probe(struct platform_device *pdev)