From patchwork Tue Oct 7 13:09:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5046011 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2ABB2C11AB for ; Tue, 7 Oct 2014 13:09:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A0FD201FE for ; Tue, 7 Oct 2014 13:09:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1DC39201F5 for ; Tue, 7 Oct 2014 13:09:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 611022604FF; Tue, 7 Oct 2014 15:09:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1697D260485; Tue, 7 Oct 2014 15:09:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C66E1260490; Tue, 7 Oct 2014 15:09:34 +0200 (CEST) Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) by alsa0.perex.cz (Postfix) with ESMTP id C0416260484 for ; Tue, 7 Oct 2014 15:09:27 +0200 (CEST) Received: from ayla.of.borg ([84.193.84.167]) by andre.telenet-ops.be with bizsmtp id 0D9S1p00c3cczKo01D9SLM; Tue, 07 Oct 2014 15:09:27 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.76) (envelope-from ) id 1XbUW6-00037j-9H; Tue, 07 Oct 2014 15:09:26 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1XbUWA-0001fr-Ia; Tue, 07 Oct 2014 15:09:30 +0200 From: Geert Uytterhoeven To: Liam Girdwood , Mark Brown , Dylan Reid Date: Tue, 7 Oct 2014 15:09:26 +0200 Message-Id: <1412687366-6400-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Cc: Alexandre Courbot , alsa-devel@alsa-project.org, Kuninori Morimoto , Geert Uytterhoeven , linux-sh@vger.kernel.org, Linus Walleij Subject: [alsa-devel] [PATCH] ASoC: simple-card: Initialize headphone and mic GPIO numbers X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,