From patchwork Tue Aug 30 19:52:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjeev Premi X-Patchwork-Id: 112379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6690AB6F7D for ; Wed, 31 Aug 2011 05:54:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7146428082; Tue, 30 Aug 2011 21:54:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uoO+8PRk403T; Tue, 30 Aug 2011 21:54:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 917AB280A6; Tue, 30 Aug 2011 21:53:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 042F828088 for ; Tue, 30 Aug 2011 21:53:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lEURTboACKb5 for ; Tue, 30 Aug 2011 21:53:40 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by theia.denx.de (Postfix) with ESMTPS id 2495928080 for ; Tue, 30 Aug 2011 21:53:38 +0200 (CEST) Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7UJrBkW012505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 30 Aug 2011 14:53:13 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7UJrAte027266; Wed, 31 Aug 2011 01:23:10 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Wed, 31 Aug 2011 01:23:10 +0530 Received: from psplinux050.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7UJqsok028753; Wed, 31 Aug 2011 01:23:10 +0530 (IST) From: Sanjeev Premi To: Date: Wed, 31 Aug 2011 01:22:33 +0530 Message-ID: <1314733954-29576-3-git-send-email-premi@ti.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1314733954-29576-1-git-send-email-premi@ti.com> References: <1314733954-29576-1-git-send-email-premi@ti.com> MIME-Version: 1.0 Cc: Nishanth Menon , Igor@theia.denx.de, Steve Sakoman , Shashi Ranjan , Sunil Kumar , Luca Ceresoli Subject: [U-Boot] [RFC 2/3] omap: gpio: generic changes after changing API X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch contains the generic changes required after change to generic API in the previous patch. Signed-off-by: Sanjeev Premi Cc: Sandeep Paulraj Cc: Igor Grinberg Cc: Luca Ceresoli Cc: Enric Balletbo i Serra Cc: Sunil Kumar Cc: Shashi Ranjan Cc: Nishanth Menon Cc: Steve Sakoman --- These changes could have been merged with the previous patch, but kept changes to API separate from the usage. arch/arm/cpu/armv7/omap4/clocks.c | 4 ++-- doc/README.omap3 | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm/cpu/armv7/omap4/clocks.c b/arch/arm/cpu/armv7/omap4/clocks.c index eda960c..56cdbe4 100644 --- a/arch/arm/cpu/armv7/omap4/clocks.c +++ b/arch/arm/cpu/armv7/omap4/clocks.c @@ -481,8 +481,8 @@ static void do_scale_tps62361(u32 reg, u32 volt_mv) * VSEL1 is grounded on board. So the following selects * VSEL1 = 0 and VSEL0 = 1 */ - omap_set_gpio_direction(TPS62361_VSEL0_GPIO, 0); - omap_set_gpio_dataout(TPS62361_VSEL0_GPIO, 1); + gpio_direction_output(TPS62361_VSEL0_GPIO); + gpio_set_value(TPS62361_VSEL0_GPIO, 1); temp = TPS62361_I2C_SLAVE_ADDR | (reg << PRM_VC_VAL_BYPASS_REGADDR_SHIFT) | diff --git a/doc/README.omap3 b/doc/README.omap3 index 460950d..2a18133 100644 --- a/doc/README.omap3 +++ b/doc/README.omap3 @@ -98,24 +98,24 @@ gpio To set a bit : - if (!omap_request_gpio(N)) { - omap_set_gpio_direction(N, 0); - omap_set_gpio_dataout(N, 1); + if (!gpio_request(N, "")) { + gpio_direction_output(N); + gpio_set_value(N, 1); } To clear a bit : - if (!omap_request_gpio(N)) { - omap_set_gpio_direction(N, 0); - omap_set_gpio_dataout(N, 0); + if (!gpio_request(N, "")) { + gpio_direction_output(N); + gpio_set_value(N, 0); } To read a bit : - if (!omap_request_gpio(N)) { - omap_set_gpio_direction(N, 1); - val = omap_get_gpio_datain(N); - omap_free_gpio(N); + if (!gpio_request(N, "")) { + gpio_direction_input(N); + val = gpio_get_value(N); + gpio_free(N); } if (val) printf("GPIO N is set\n");