* [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers
@ 2014-10-07 13:09 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-10-07 13:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Dylan Reid
Cc: Linus Walleij, Alexandre Courbot, Kuninori Morimoto, alsa-devel,
linux-sh, Geert Uytterhoeven
The uninitialized default of 0 for gpio_hp_det and gpio_mic_det doesn't
play well with asm-generic's gpio_is_valid():
static inline bool gpio_is_valid(int number)
{
return number >= 0 && number < ARCH_NR_GPIOS;
}
Hence on r8a7740/armadillo-legacy:
sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Mic Jack
After that the kernel log is spammed ca. 7 times per second with:
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones
Initialize the GPIO numbers with a negative number (-ENOENT) to fix this.
Fixes: 3fe240326cc395c6 ("ASoC: simple-card: Add mic and hp detect gpios.")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is against sound-asoc/for-next
sound/soc/generic/simple-card.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fcb431fe20b4ae7b..d1b7293c133eaa45 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -501,6 +501,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
priv->snd_card.dai_link = dai_link;
priv->snd_card.num_links = num_links;
+ priv->gpio_hp_det = -ENOENT;
+ priv->gpio_mic_det = -ENOENT;
+
/* Get room for the other properties */
priv->dai_props = devm_kzalloc(dev,
sizeof(*priv->dai_props) * num_links,
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers
@ 2014-10-07 13:09 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-10-07 13:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Dylan Reid
Cc: Linus Walleij, Alexandre Courbot, Kuninori Morimoto, alsa-devel,
linux-sh, Geert Uytterhoeven
The uninitialized default of 0 for gpio_hp_det and gpio_mic_det doesn't
play well with asm-generic's gpio_is_valid():
static inline bool gpio_is_valid(int number)
{
return number >= 0 && number < ARCH_NR_GPIOS;
}
Hence on r8a7740/armadillo-legacy:
sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Mic Jack
After that the kernel log is spammed ca. 7 times per second with:
sh-mobile-hdmi sh-mobile-hdmi: ASoC: DAPM unknown pin Headphones
Initialize the GPIO numbers with a negative number (-ENOENT) to fix this.
Fixes: 3fe240326cc395c6 ("ASoC: simple-card: Add mic and hp detect gpios.")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is against sound-asoc/for-next
sound/soc/generic/simple-card.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fcb431fe20b4ae7b..d1b7293c133eaa45 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -501,6 +501,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
priv->snd_card.dai_link = dai_link;
priv->snd_card.num_links = num_links;
+ priv->gpio_hp_det = -ENOENT;
+ priv->gpio_mic_det = -ENOENT;
+
/* Get room for the other properties */
priv->dai_props = devm_kzalloc(dev,
sizeof(*priv->dai_props) * num_links,
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers
2014-10-07 13:09 ` Geert Uytterhoeven
@ 2014-10-07 17:24 ` Mark Brown
-1 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-10-07 17:24 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Liam Girdwood, Dylan Reid, Linus Walleij, Alexandre Courbot,
Kuninori Morimoto, alsa-devel, linux-sh
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
On Tue, Oct 07, 2014 at 03:09:26PM +0200, Geert Uytterhoeven wrote:
> The uninitialized default of 0 for gpio_hp_det and gpio_mic_det doesn't
> play well with asm-generic's gpio_is_valid():
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers
@ 2014-10-07 17:24 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-10-07 17:24 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Liam Girdwood, Dylan Reid, Linus Walleij, Alexandre Courbot,
Kuninori Morimoto, alsa-devel, linux-sh
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
On Tue, Oct 07, 2014 at 03:09:26PM +0200, Geert Uytterhoeven wrote:
> The uninitialized default of 0 for gpio_hp_det and gpio_mic_det doesn't
> play well with asm-generic's gpio_is_valid():
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-07 17:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07 13:09 [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers Geert Uytterhoeven
2014-10-07 13:09 ` Geert Uytterhoeven
2014-10-07 17:24 ` Mark Brown
2014-10-07 17:24 ` 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.