From patchwork Fri Mar 29 02:43:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2363031 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by patchwork2.kernel.org (Postfix) with ESMTP id 8D768DF2A1 for ; Fri, 29 Mar 2013 02:56:32 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2EE1FDFF; Fri, 29 Mar 2013 02:47:44 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTP id C3044DB5 for ; Fri, 29 Mar 2013 02:47:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 8430720123 for ; Fri, 29 Mar 2013 02:47:34 +0000 (UTC) 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 31AA42C69F7; Fri, 29 Mar 2013 13:45:58 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id C2715EDEA32; Fri, 29 Mar 2013 11:45:56 +0900 (JST) From: Simon Horman To: ltsi-dev@lists.linuxfoundation.org Date: Fri, 29 Mar 2013 11:43:46 +0900 Message-Id: <1364525119-31791-298-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364525119-31791-1-git-send-email-horms+renesas@verge.net.au> References: <1364525119-31791-1-git-send-email-horms+renesas@verge.net.au> X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Magnus Damm Subject: [LTSI-dev] [PATCH/RFC 297/390] ARM: shmobile: armadillo800eva: Use gpio_request_one() X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.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 (cherry picked from commit 0f69e708159ded249fb73f8fe40508100a2cc54e) Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-armadillo800eva.c | 48 +++++++++--------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index fdc7518..5595497 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -1001,16 +1001,12 @@ static void __init eva_init(void) gpio_request(GPIO_FN_LCD0_DISP, NULL); gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL); - gpio_request(GPIO_PORT61, NULL); /* LCDDON */ - gpio_direction_output(GPIO_PORT61, 1); - - gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */ - gpio_direction_output(GPIO_PORT202, 0); + gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ + gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */ /* Touchscreen */ gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */ - gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */ - gpio_direction_output(GPIO_PORT166, 1); + gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */ /* GETHER */ gpio_request(GPIO_FN_ET_CRS, NULL); @@ -1033,12 +1029,10 @@ static void __init eva_init(void) gpio_request(GPIO_FN_ET_RX_DV, NULL); gpio_request(GPIO_FN_ET_RX_CLK, NULL); - gpio_request(GPIO_PORT18, NULL); /* PHY_RST */ - gpio_direction_output(GPIO_PORT18, 1); + gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */ /* USB */ - gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */ - gpio_direction_input(GPIO_PORT159); + gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */ if (gpio_get_value(GPIO_PORT159)) { /* USB Host */ @@ -1052,8 +1046,7 @@ static void __init eva_init(void) * and select GPIO_PORT209 here */ gpio_request(GPIO_FN_IRQ7_PORT209, NULL); - gpio_request(GPIO_PORT209, NULL); - gpio_direction_input(GPIO_PORT209); + gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL); platform_device_register(&usbhsf_device); usb = &usbhsf_device; @@ -1068,12 +1061,9 @@ static void __init eva_init(void) gpio_request(GPIO_FN_SDHI0_D3, NULL); gpio_request(GPIO_FN_SDHI0_WP, NULL); - gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */ - gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */ - gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */ - gpio_direction_output(GPIO_PORT17, 0); - gpio_direction_output(GPIO_PORT74, 1); - gpio_direction_output(GPIO_PORT75, 1); + gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL); /* SDHI0_18/33_B */ + gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */ + gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */ /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */ @@ -1110,12 +1100,10 @@ static void __init eva_init(void) gpio_request(GPIO_FN_VIO_CKO, NULL); /* CON1/CON15 Camera */ - gpio_request(GPIO_PORT173, NULL); /* STANDBY */ - gpio_request(GPIO_PORT172, NULL); /* RST */ - gpio_request(GPIO_PORT158, NULL); /* CAM_PON */ - gpio_direction_output(GPIO_PORT173, 0); - gpio_direction_output(GPIO_PORT172, 1); - gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */ + gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */ + gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */ + /* see mt9t111_power() */ + gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */ /* FSI-WM8978 */ gpio_request(GPIO_FN_FSIAIBT, NULL); @@ -1142,15 +1130,13 @@ static void __init eva_init(void) * DBGMD/LCDC0/FSIA MUX * DBGMD_SELECT_B should be set after setting PFC Function. */ - gpio_request(GPIO_PORT176, NULL); - gpio_direction_output(GPIO_PORT176, 1); + gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL); /* * We can switch CON8/CON14 by SW1.5, * but it needs after DBGMD_SELECT_B */ - gpio_request(GPIO_PORT6, NULL); - gpio_direction_input(GPIO_PORT6); + gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL); if (gpio_get_value(GPIO_PORT6)) { /* CON14 enable */ } else { @@ -1164,8 +1150,8 @@ static void __init eva_init(void) gpio_request(GPIO_FN_SDHI1_CD, NULL); gpio_request(GPIO_FN_SDHI1_WP, NULL); - gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */ - gpio_direction_output(GPIO_PORT16, 1); + /* SDSLOT2_PON */ + gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL); platform_device_register(&sdhi1_device); }