From patchwork Sun Jan 6 19:13:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Dunn X-Patchwork-Id: 1938041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AFB363FED4 for ; Sun, 6 Jan 2013 19:18:06 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TrvgJ-0003M1-B2; Sun, 06 Jan 2013 19:14:51 +0000 Received: from smtp.newsguy.com ([74.209.136.69]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Trvg2-0003GA-UQ for linux-arm-kernel@lists.infradead.org; Sun, 06 Jan 2013 19:14:35 +0000 Received: from localhost.localdomain (215.sub-70-199-230.myvzw.com [70.199.230.215]) by smtp.newsguy.com (8.14.3/8.14.3) with ESMTP id r06JDpxn085967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Jan 2013 11:14:26 -0800 (PST) (envelope-from mikedunn@newsguy.com) From: Mike Dunn To: alsa-devel@alsa-project.org Subject: [PATCH 3/4] ALSA: pxa27x: ac97 controller driver requests gpio Date: Sun, 6 Jan 2013 11:13:59 -0800 Message-Id: <1357499640-13871-4-git-send-email-mikedunn@newsguy.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1357499640-13871-1-git-send-email-mikedunn@newsguy.com> References: <1357499640-13871-1-git-send-email-mikedunn@newsguy.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130106_141435_347779_7323B2CE X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marek Vasut , Mike Dunn , Mark Brown , Igor Grinberg , Eric Miao , Robert Jarzmik , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org During initialization, the ac97 driver must obtain the gpio for the mfp that is used by the ac97 controller as the AC97_nRESET line, or else gpiolib will issue a warning and stack dump. Gpiolib may change this to a hard error soon. The line is used during an ac97 warm reset for working around a hardware bug in the controller. Tested on a palm treo 680 machine. Signed-off-by: Mike Dunn --- sound/arm/pxa2xx-ac97-lib.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 1ecd0a66..416d2e3 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -344,7 +345,12 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev) } if (cpu_is_pxa27x()) { - /* Use GPIO 113 as AC97 Reset on Bulverde */ + ret = gpio_request(reset_gpio, "pxa27x ac97 reset"); + if (ret < 0) { + pr_err("%s: gpio_request() failed: %d\n", + __func__, ret); + goto err_conf; + } pxa27x_assert_ac97reset(reset_gpio, 0); ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK"); if (IS_ERR(ac97conf_clk)) { @@ -388,6 +394,8 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe); void pxa2xx_ac97_hw_remove(struct platform_device *dev) { + if (cpu_is_pxa27x()) + gpio_free(reset_gpio); GCR |= GCR_ACLINK_OFF; free_irq(IRQ_AC97, NULL); if (ac97conf_clk) {