diff mbox

[1/4] ASoC: brownstone: Automatically disconnect non-connected pins

Message ID 1431026869-27206-1-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit 6b9aa50cd239ff78f6680d070315608a49218159
Headers show

Commit Message

Lars-Peter Clausen May 7, 2015, 7:27 p.m. UTC
Most DAPM input and output pins of the wm8994 are either used in the card's
DAPM routing table or are marked as not connected.

The only exception is DMIC2DAT input. Given that DMIC1DAT is explicitly
mentioned in the DAPM routes lets assume that DMIC2DAT simply has been
overlooked and should be 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>
---
 sound/soc/pxa/brownstone.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

Comments

Mark Brown May 8, 2015, 11:05 a.m. UTC | #1
On Thu, May 07, 2015 at 09:27:46PM +0200, Lars-Peter Clausen wrote:
> Most DAPM input and output pins of the wm8994 are either used in the card's
> DAPM routing table or are marked as not connected.

Applied all, thanks.
diff mbox

Patch

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 79936e3..2b26318 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -45,29 +45,6 @@  static const struct snd_soc_dapm_route brownstone_audio_map[] = {
 	{"MICBIAS1", NULL, "Main Mic"},
 };
 
-static int brownstone_wm8994_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	/* set endpoints to not connected */
-	snd_soc_dapm_nc_pin(dapm, "HPOUT2P");
-	snd_soc_dapm_nc_pin(dapm, "HPOUT2N");
-	snd_soc_dapm_nc_pin(dapm, "LINEOUT1N");
-	snd_soc_dapm_nc_pin(dapm, "LINEOUT1P");
-	snd_soc_dapm_nc_pin(dapm, "LINEOUT2N");
-	snd_soc_dapm_nc_pin(dapm, "LINEOUT2P");
-	snd_soc_dapm_nc_pin(dapm, "IN1LN");
-	snd_soc_dapm_nc_pin(dapm, "IN1LP");
-	snd_soc_dapm_nc_pin(dapm, "IN1RP");
-	snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN");
-	snd_soc_dapm_nc_pin(dapm, "IN2RN");
-	snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");
-	snd_soc_dapm_nc_pin(dapm, "IN2LN");
-
-	return 0;
-}
-
 static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 				       struct snd_pcm_hw_params *params)
 {
@@ -115,7 +92,6 @@  static struct snd_soc_dai_link brownstone_wm8994_dai[] = {
 	.dai_fmt	= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 				SND_SOC_DAIFMT_CBS_CFS,
 	.ops		= &brownstone_ops,
-	.init		= brownstone_wm8994_init,
 },
 };
 
@@ -132,6 +108,7 @@  static struct snd_soc_card brownstone = {
 	.num_dapm_widgets = ARRAY_SIZE(brownstone_dapm_widgets),
 	.dapm_routes = brownstone_audio_map,
 	.num_dapm_routes = ARRAY_SIZE(brownstone_audio_map),
+	.fully_routed = true,
 };
 
 static int brownstone_probe(struct platform_device *pdev)