Patchwork [U-Boot,2/3] omap: gpio: generic changes after changing API

login
register
mail settings
Submitter Sanjeev Premi
Date Sept. 5, 2011, 8:28 p.m.
Message ID <1315254528-8644-3-git-send-email-premi@ti.com>
Download mbox | patch
Permalink /patch/113439/
State Accepted
Commit 3b690ebbbf21303a3bac1f62d967c36cd8655ce0
Headers show

Comments

Sanjeev Premi - Sept. 5, 2011, 8:28 p.m.
This patch contains the generic changes required after
change to generic API in the previous patch.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---

 This patch could have been merged with previous one, but
 has been kept separate to illustrate (and review) the
 changes to generic code.

 arch/arm/cpu/armv7/omap4/clocks.c |    5 +++--
 doc/README.omap3                  |   20 ++++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)

Patch

diff --git a/arch/arm/cpu/armv7/omap4/clocks.c b/arch/arm/cpu/armv7/omap4/clocks.c
index eda960c..4f0e0cd 100644
--- a/arch/arm/cpu/armv7/omap4/clocks.c
+++ b/arch/arm/cpu/armv7/omap4/clocks.c
@@ -31,6 +31,7 @@ 
  */
 #include <common.h>
 #include <asm/omap_common.h>
+#include <asm/gpio.h>
 #include <asm/arch/clocks.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/utils.h>
@@ -481,8 +482,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, 0);
+	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..1768cdd 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, 0);
+		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, 0);
+		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");