All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins
@ 2015-01-16 13:34 Lars-Peter Clausen
  2015-01-16 13:34 ` [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin() Lars-Peter Clausen
  2015-01-16 16:59 ` [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2015-01-16 13:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Sangbeom Kim, alsa-devel, Lars-Peter Clausen

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>
---
 sound/soc/samsung/jive_wm8750.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/sound/soc/samsung/jive_wm8750.c b/sound/soc/samsung/jive_wm8750.c
index 6c3b359..7fcb51f 100644
--- a/sound/soc/samsung/jive_wm8750.c
+++ b/sound/soc/samsung/jive_wm8750.c
@@ -83,22 +83,6 @@ static struct snd_soc_ops jive_ops = {
 	.hw_params	= jive_hw_params,
 };
 
-static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	/* These endpoints are not being used. */
-	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, "MONO");
-
-	return 0;
-}
-
 static struct snd_soc_dai_link jive_dai = {
 	.name		= "wm8750",
 	.stream_name	= "WM8750",
@@ -106,7 +90,6 @@ static struct snd_soc_dai_link jive_dai = {
 	.codec_dai_name = "wm8750-hifi",
 	.platform_name	= "s3c2412-i2s",
 	.codec_name	= "wm8750.0-001a",
-	.init		= jive_wm8750_init,
 	.dai_fmt	= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			  SND_SOC_DAIFMT_CBS_CFS,
 	.ops		= &jive_ops,
@@ -123,6 +106,7 @@ static struct snd_soc_card snd_soc_machine_jive = {
 	.num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
 	.dapm_routes	= audio_map,
 	.num_dapm_routes = ARRAY_SIZE(audio_map),
+	.fully_routed	= true,
 };
 
 static struct platform_device *jive_snd_device;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin()
  2015-01-16 13:34 [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Lars-Peter Clausen
@ 2015-01-16 13:34 ` Lars-Peter Clausen
  2015-01-16 16:59   ` Mark Brown
  2015-01-16 16:59 ` [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2015-01-16 13:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Sangbeom Kim, alsa-devel, Lars-Peter Clausen

The "MicIn" widget is a card level DAPM element so pass the card's DAPM
context instead of the CODEC's DAPM context to snd_soc_dapm_disable_pin().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/samsung/smdk_wm8580.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c
index 17a2f71..548bfd9 100644
--- a/sound/soc/samsung/smdk_wm8580.c
+++ b/sound/soc/samsung/smdk_wm8580.c
@@ -136,13 +136,10 @@ static const struct snd_soc_dapm_route smdk_wm8580_audio_map[] = {
 
 static int smdk_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
 	/* Enabling the microphone requires the fitting of a 0R
 	 * resistor to connect the line from the microphone jack.
 	 */
-	snd_soc_dapm_disable_pin(dapm, "MicIn");
+	snd_soc_dapm_disable_pin(&rtd->card->dapm, "MicIn");
 
 	return 0;
 }
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins
  2015-01-16 13:34 [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Lars-Peter Clausen
  2015-01-16 13:34 ` [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin() Lars-Peter Clausen
@ 2015-01-16 16:59 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-01-16 16:59 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Sangbeom Kim, alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 216 bytes --]

On Fri, Jan 16, 2015 at 02:34:52PM +0100, Lars-Peter Clausen wrote:
> 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.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin()
  2015-01-16 13:34 ` [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin() Lars-Peter Clausen
@ 2015-01-16 16:59   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-01-16 16:59 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Sangbeom Kim, alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 237 bytes --]

On Fri, Jan 16, 2015 at 02:34:53PM +0100, Lars-Peter Clausen wrote:
> The "MicIn" widget is a card level DAPM element so pass the card's DAPM
> context instead of the CODEC's DAPM context to snd_soc_dapm_disable_pin().

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-16 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16 13:34 [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Lars-Peter Clausen
2015-01-16 13:34 ` [PATCH 2/2] ASoC: smdk_wm8580: Pass card DAPM context to snd_soc_dapm_disable_pin() Lars-Peter Clausen
2015-01-16 16:59   ` Mark Brown
2015-01-16 16:59 ` [PATCH 1/2] ASoC: jive: Automatically disconnect non-connected pins Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.