From patchwork Fri Mar 29 02:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2363021 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 388FBDF2A1 for ; Fri, 29 Mar 2013 02:56:30 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 13555DFE; 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 80732B5F 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 5084D200FD for ; Fri, 29 Mar 2013 02:47:33 +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 146A62C6A72; Fri, 29 Mar 2013 13:45:58 +1100 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id AC12AEDEA29; 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:43 +0900 Message-Id: <1364525119-31791-295-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 294/390] ARM: shmobile: ap4evb: 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 5683eafdfd039681a0d30c402a0675b521313659) 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 59b3044..7f54423 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -1170,9 +1170,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); @@ -1238,18 +1236,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); @@ -1297,8 +1287,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); @@ -1306,8 +1295,7 @@ static void __init ap4evb_init(void) gpio_no_direction(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); @@ -1395,11 +1383,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;