All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
@ 2015-04-11  9:18 Lars-Peter Clausen
  2015-04-13  8:53 ` Nicolas Ferre
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2015-04-11  9:18 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Lars-Peter Clausen, Nicolas Ferre

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>
---
 sound/soc/atmel/sam9g20_wm8731.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 8de8361..d7469cd 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[] = {
 
 static const struct snd_soc_dapm_route intercon[] = {
 
-	/* speaker connected to LHPOUT */
+	/* speaker connected to LHPOUT/RHPOUT */
 	{"Ext Spk", NULL, "LHPOUT"},
+	{"Ext Spk", NULL, "RHPOUT"},
 
 	/* mic is connected to Mic Jack, with WM8731 Mic Bias */
 	{"MICIN", NULL, "Mic Bias"},
@@ -108,9 +109,7 @@ static const struct snd_soc_dapm_route intercon[] = {
  */
 static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
 	int ret;
 
 	printk(KERN_DEBUG
@@ -124,10 +123,6 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 		return ret;
 	}
 
-	/* not connected */
-	snd_soc_dapm_nc_pin(dapm, "RLINEIN");
-	snd_soc_dapm_nc_pin(dapm, "LLINEIN");
-
 #ifndef ENABLE_MIC_INPUT
 	snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
 #endif
@@ -158,6 +153,7 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
 	.num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
 	.dapm_routes = intercon,
 	.num_dapm_routes = ARRAY_SIZE(intercon),
+	.fully_routed = true,
 };
 
 static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
-- 
1.8.0

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

* Re: [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
  2015-04-11  9:18 [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins Lars-Peter Clausen
@ 2015-04-13  8:53 ` Nicolas Ferre
  2015-04-13  9:02   ` Lars-Peter Clausen
  2015-04-13  9:07 ` Nicolas Ferre
  2015-04-18 12:20 ` Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Nicolas Ferre @ 2015-04-13  8:53 UTC (permalink / raw)
  To: Lars-Peter Clausen, Mark Brown, Liam Girdwood; +Cc: alsa-devel

Le 11/04/2015 11:18, Lars-Peter Clausen a écrit :
> 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().

I don't understand: on the schematics, both the "RLINEIN" and "LLINEIN"
are actually not connected. So, why remove these calls to
snd_soc_dapm_nc_pin(). Note also that "ROUT" and "LOUT" signals are not
connected as well.

But note that I don't know precisely ASoC either...

Bye,


> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  sound/soc/atmel/sam9g20_wm8731.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
> index 8de8361..d7469cd 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[] = {
>  
>  static const struct snd_soc_dapm_route intercon[] = {
>  
> -	/* speaker connected to LHPOUT */
> +	/* speaker connected to LHPOUT/RHPOUT */
>  	{"Ext Spk", NULL, "LHPOUT"},
> +	{"Ext Spk", NULL, "RHPOUT"},
>  
>  	/* mic is connected to Mic Jack, with WM8731 Mic Bias */
>  	{"MICIN", NULL, "Mic Bias"},
> @@ -108,9 +109,7 @@ static const struct snd_soc_dapm_route intercon[] = {
>   */
>  static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
>  {
> -	struct snd_soc_codec *codec = rtd->codec;
>  	struct snd_soc_dai *codec_dai = rtd->codec_dai;
> -	struct snd_soc_dapm_context *dapm = &codec->dapm;
>  	int ret;
>  
>  	printk(KERN_DEBUG
> @@ -124,10 +123,6 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
>  		return ret;
>  	}
>  
> -	/* not connected */
> -	snd_soc_dapm_nc_pin(dapm, "RLINEIN");
> -	snd_soc_dapm_nc_pin(dapm, "LLINEIN");
> -
>  #ifndef ENABLE_MIC_INPUT
>  	snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
>  #endif
> @@ -158,6 +153,7 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
>  	.num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
>  	.dapm_routes = intercon,
>  	.num_dapm_routes = ARRAY_SIZE(intercon),
> +	.fully_routed = true,
>  };
>  
>  static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
  2015-04-13  8:53 ` Nicolas Ferre
@ 2015-04-13  9:02   ` Lars-Peter Clausen
  2015-04-13  9:07     ` Nicolas Ferre
  0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2015-04-13  9:02 UTC (permalink / raw)
  To: Nicolas Ferre, Mark Brown, Liam Girdwood; +Cc: alsa-devel

On 04/13/2015 10:53 AM, Nicolas Ferre wrote:
> Le 11/04/2015 11:18, Lars-Peter Clausen a écrit :
>> 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().
>
> I don't understand: on the schematics, both the "RLINEIN" and "LLINEIN"
> are actually not connected. So, why remove these calls to
> snd_soc_dapm_nc_pin(). Note also that "ROUT" and "LOUT" signals are not
> connected as well.
>

For legacy reasons by default a INPUT or OUTPUT pin is considered connected 
unless explicitly marked as non-connected. When the fully_routed flag is set 
INPUT and OUTPUT pins are considered to be not connected unless explicitly 
connected. What the patch does is set the fully_routed flag and remove the 
explicit calls to snd_soc_dapm_nc_pin() since the pins are now considered to 
be non-connected by default.

- Lars

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

* Re: [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
  2015-04-13  9:02   ` Lars-Peter Clausen
@ 2015-04-13  9:07     ` Nicolas Ferre
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2015-04-13  9:07 UTC (permalink / raw)
  To: Lars-Peter Clausen, Mark Brown, Liam Girdwood; +Cc: alsa-devel

Le 13/04/2015 11:02, Lars-Peter Clausen a écrit :
> On 04/13/2015 10:53 AM, Nicolas Ferre wrote:
>> Le 11/04/2015 11:18, Lars-Peter Clausen a écrit :
>>> 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().
>>
>> I don't understand: on the schematics, both the "RLINEIN" and "LLINEIN"
>> are actually not connected. So, why remove these calls to
>> snd_soc_dapm_nc_pin(). Note also that "ROUT" and "LOUT" signals are not
>> connected as well.
>>
> 
> For legacy reasons by default a INPUT or OUTPUT pin is considered connected 
> unless explicitly marked as non-connected. When the fully_routed flag is set 
> INPUT and OUTPUT pins are considered to be not connected unless explicitly 
> connected. What the patch does is set the fully_routed flag and remove the 
> explicit calls to snd_soc_dapm_nc_pin() since the pins are now considered to 
> be non-connected by default.

Hopefully I warned that I wasn't aware of ASoC ;-)
Ok then.

Bye,
-- 
Nicolas Ferre

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

* Re: [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
  2015-04-11  9:18 [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins Lars-Peter Clausen
  2015-04-13  8:53 ` Nicolas Ferre
@ 2015-04-13  9:07 ` Nicolas Ferre
  2015-04-18 12:20 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2015-04-13  9:07 UTC (permalink / raw)
  To: Lars-Peter Clausen, Mark Brown, Liam Girdwood; +Cc: alsa-devel

Le 11/04/2015 11:18, Lars-Peter Clausen a écrit :
> 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>

It seems good:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  sound/soc/atmel/sam9g20_wm8731.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
> index 8de8361..d7469cd 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[] = {
>  
>  static const struct snd_soc_dapm_route intercon[] = {
>  
> -	/* speaker connected to LHPOUT */
> +	/* speaker connected to LHPOUT/RHPOUT */
>  	{"Ext Spk", NULL, "LHPOUT"},
> +	{"Ext Spk", NULL, "RHPOUT"},
>  
>  	/* mic is connected to Mic Jack, with WM8731 Mic Bias */
>  	{"MICIN", NULL, "Mic Bias"},
> @@ -108,9 +109,7 @@ static const struct snd_soc_dapm_route intercon[] = {
>   */
>  static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
>  {
> -	struct snd_soc_codec *codec = rtd->codec;
>  	struct snd_soc_dai *codec_dai = rtd->codec_dai;
> -	struct snd_soc_dapm_context *dapm = &codec->dapm;
>  	int ret;
>  
>  	printk(KERN_DEBUG
> @@ -124,10 +123,6 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
>  		return ret;
>  	}
>  
> -	/* not connected */
> -	snd_soc_dapm_nc_pin(dapm, "RLINEIN");
> -	snd_soc_dapm_nc_pin(dapm, "LLINEIN");
> -
>  #ifndef ENABLE_MIC_INPUT
>  	snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
>  #endif
> @@ -158,6 +153,7 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
>  	.num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets),
>  	.dapm_routes = intercon,
>  	.num_dapm_routes = ARRAY_SIZE(intercon),
> +	.fully_routed = true,
>  };
>  
>  static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins
  2015-04-11  9:18 [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins Lars-Peter Clausen
  2015-04-13  8:53 ` Nicolas Ferre
  2015-04-13  9:07 ` Nicolas Ferre
@ 2015-04-18 12:20 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2015-04-18 12:20 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, Nicolas Ferre, Liam Girdwood


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

On Sat, Apr 11, 2015 at 11:18:43AM +0200, Lars-Peter Clausen wrote:
> 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.

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] 6+ messages in thread

end of thread, other threads:[~2015-04-18 12:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-11  9:18 [PATCH] ASoC: at91sam9g20ek: Automatically disconnect non-connected pins Lars-Peter Clausen
2015-04-13  8:53 ` Nicolas Ferre
2015-04-13  9:02   ` Lars-Peter Clausen
2015-04-13  9:07     ` Nicolas Ferre
2015-04-13  9:07 ` Nicolas Ferre
2015-04-18 12:20 ` 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.