From patchwork Tue Jun 21 17:49:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 101336 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8FBF9B6F71 for ; Wed, 22 Jun 2011 03:43:54 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QZ4zC-0003GG-2R; Tue, 21 Jun 2011 17:43:38 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QZ4zB-0001Dh-8s; Tue, 21 Jun 2011 17:43:37 +0000 Received: from am1ehsobe002.messaging.microsoft.com ([213.199.154.205] helo=AM1EHSOBE002.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QZ4yU-00017O-Pg for linux-arm-kernel@lists.infradead.org; Tue, 21 Jun 2011 17:43:02 +0000 Received: from mail94-am1-R.bigfish.com (10.3.201.254) by AM1EHSOBE002.bigfish.com (10.3.204.22) with Microsoft SMTP Server id 14.1.225.22; Tue, 21 Jun 2011 17:42:52 +0000 Received: from mail94-am1 (localhost.localdomain [127.0.0.1]) by mail94-am1-R.bigfish.com (Postfix) with ESMTP id A449A998395; Tue, 21 Jun 2011 17:42:52 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail94-am1 (localhost.localdomain [127.0.0.1]) by mail94-am1 (MessageSwitch) id 1308678172392399_32486; Tue, 21 Jun 2011 17:42:52 +0000 (UTC) Received: from AM1EHSMHS012.bigfish.com (unknown [10.3.201.251]) by mail94-am1.bigfish.com (Postfix) with ESMTP id 539811410050; Tue, 21 Jun 2011 17:42:52 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS012.bigfish.com (10.3.207.112) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 21 Jun 2011 17:42:52 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Tue, 21 Jun 2011 12:42:51 -0500 Received: from localhost.localdomain ([10.29.240.182]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p5LHgkti028229; Tue, 21 Jun 2011 12:42:49 -0500 (CDT) From: Fabio Estevam To: Subject: [PATCH 3/3] mxc: iomuxv1: Do not use gpio_request when setting the pin as GPIO Date: Tue, 21 Jun 2011 14:49:37 -0300 Message-ID: <1308678577-25277-3-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1308678577-25277-2-git-send-email-fabio.estevam@freescale.com> References: <1308678577-25277-1-git-send-email-fabio.estevam@freescale.com> <1308678577-25277-2-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110621_134255_086637_9CE60E70 X-CRM114-Status: GOOD ( 18.85 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.205 listed in list.dnswl.org] Cc: Fabio Estevam , kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org When setting the IOMUX of multiple pins via mxc_gpio_setup_multiple_pins, gpio_request is called and this prevents subsequent calls of gpio_request done by drivers to succeed. Remove gpio_request call from mxc_gpio_setup_multiple_pins function. As gpio_request is removed from mxc_gpio_setup_multiple_pins, there is no need to have mxc_gpio_release_multiple_pins anymore, so remove this function. Tested on a mx27_3ds board and after applying this patch it is possible to define all the IOMUX setup in a static array Signed-off-by: Fabio Estevam --- arch/arm/plat-mxc/include/mach/iomux-v1.h | 1 - arch/arm/plat-mxc/iomux-v1.c | 32 ----------------------------- 2 files changed, 0 insertions(+), 33 deletions(-) diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h index a7fc51e..6fa8a70 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v1.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h @@ -95,7 +95,6 @@ extern int mxc_gpio_mode(int gpio_mode); extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, const char *label); -extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count); extern int __init imx_iomuxv1_init(void __iomem *base, int numports); diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c index 3238c10..d76f3ac 100644 --- a/arch/arm/plat-mxc/iomux-v1.c +++ b/arch/arm/plat-mxc/iomux-v1.c @@ -172,45 +172,13 @@ static int imx_iomuxv1_setup_multiple(const int *list, unsigned count) int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, const char *label) { - size_t i; int ret; - for (i = 0; i < count; ++i) { - unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK); - - ret = gpio_request(gpio, label); - if (ret) - goto err_gpio_request; - } - ret = imx_iomuxv1_setup_multiple(pin_list, count); - if (ret) - goto err_setup; - - return 0; - -err_setup: - BUG_ON(i != count); - -err_gpio_request: - mxc_gpio_release_multiple_pins(pin_list, i); - return ret; } EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins); -void mxc_gpio_release_multiple_pins(const int *pin_list, int count) -{ - size_t i; - - for (i = 0; i < count; ++i) { - unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK); - - gpio_free(gpio); - } -} -EXPORT_SYMBOL(mxc_gpio_release_multiple_pins); - int __init imx_iomuxv1_init(void __iomem *base, int numports) { imx_iomuxv1_baseaddr = base;