From patchwork Thu Jan 31 06:23:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2071181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 89091DFB79 for ; Thu, 31 Jan 2013 06:28:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0nag-0004NA-Rh; Thu, 31 Jan 2013 06:25:43 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0nZC-0003ml-09 for linux-arm-kernel@lists.infradead.org; Thu, 31 Jan 2013 06:24:14 +0000 Received: from ayumi.akashicho.tokyo.vergenet.net (p8120-ipbfp1001kobeminato.hyogo.ocn.ne.jp [118.10.137.120]) by kirsty.vergenet.net (Postfix) with ESMTP id DB9A325BF77; Thu, 31 Jan 2013 17:24:07 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 83BE8EDE8BC; Thu, 31 Jan 2013 15:24:06 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Subject: [PATCH 2/9] ARM: shmobile: ap4evb: Use gpio_request_one() Date: Thu, 31 Jan 2013 15:23:55 +0900 Message-Id: <1359613442-26038-3-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359613442-26038-1-git-send-email-horms+renesas@verge.net.au> References: <1359613442-26038-1-git-send-email-horms+renesas@verge.net.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130131_012410_675972_DCF61F59 X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [202.4.237.240 listed in list.dnswl.org] -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: Laurent Pinchart , linux-sh@vger.kernel.org, Magnus Damm , arm@kernel.org, Simon Horman , 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 From: Laurent Pinchart Replace occurences of gpio_request() and gpio_direction_*() by calls to gpio_request_one(). Signed-off-by: Laurent Pinchart Acked-by: Guennadi Liakhovetski Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-ap4evb.c | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 70d287c..0c59464 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -1046,9 +1046,7 @@ static int ts_get_pendown_state(void) gpio_free(GPIO_TSC_IRQ); - gpio_request(GPIO_TSC_PORT, NULL); - - gpio_direction_input(GPIO_TSC_PORT); + gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL); val = gpio_get_value(GPIO_TSC_PORT); @@ -1129,18 +1127,10 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_IRQ6_39, NULL); /* enable Debug switch (S6) */ - gpio_request(GPIO_PORT32, NULL); - gpio_request(GPIO_PORT33, NULL); - gpio_request(GPIO_PORT34, NULL); - gpio_request(GPIO_PORT35, NULL); - gpio_direction_input(GPIO_PORT32); - gpio_direction_input(GPIO_PORT33); - gpio_direction_input(GPIO_PORT34); - gpio_direction_input(GPIO_PORT35); - gpio_export(GPIO_PORT32, 0); - gpio_export(GPIO_PORT33, 0); - gpio_export(GPIO_PORT34, 0); - gpio_export(GPIO_PORT35, 0); + gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL); + gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL); + gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL); + gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL); /* SDHI0 */ gpio_request(GPIO_FN_SDHICD0, NULL); @@ -1188,8 +1178,7 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAISLD, NULL); gpio_request(GPIO_FN_FSIAOSLD, NULL); - gpio_request(GPIO_PORT161, NULL); - gpio_direction_output(GPIO_PORT161, 0); /* slave */ + gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */ gpio_request(GPIO_PORT9, NULL); gpio_request(GPIO_PORT10, NULL); @@ -1197,8 +1186,7 @@ static void __init ap4evb_init(void) gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */ /* card detect pin for MMC slot (CN7) */ - gpio_request(GPIO_PORT41, NULL); - gpio_direction_input(GPIO_PORT41); + gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL); /* setup FSI2 port B (HDMI) */ gpio_request(GPIO_FN_FSIBCK, NULL); @@ -1286,11 +1274,8 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_LCDDISP, NULL); gpio_request(GPIO_FN_LCDDCK, NULL); - gpio_request(GPIO_PORT189, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT189, 1); - - gpio_request(GPIO_PORT151, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT151, 1); + gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */ + gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ lcdc_info.clock_source = LCDC_CLK_BUS; lcdc_info.ch[0].interface_type = RGB18;