Skip to contentSkip to conversation

OMAP3 Port kernel omap gpio interface.

PATCH New Tom Rix 2 participants 2 messages May 8, 2009 – May 9, 2009

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 3/6 OMAP3 Port kernel omap gpio interface.

Port version 2.6.27 of the linux kernel's omap gpio interface to u-boot. The orignal source is in linux/arch/arm/plat-omap/gpio.c

See doc/README.omap3 for instructions on use.

---
 cpu/arm_cortexa8/omap3/Makefile   |    1 +
 cpu/arm_cortexa8/omap3/gpio.c     |  185 +++++++++++++++++++++++++++++++++++++
 doc/README.omap3                  |   32 +++++++
 include/asm-arm/arch-omap3/gpio.h |   86 +++++++++++++++++
 4 files changed, 304 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm_cortexa8/omap3/gpio.c
 create mode 100644 include/asm-arm/arch-omap3/gpio.h
cpu/arm_cortexa8/omap3/Makefile +1 -0
index edf5cb2..50176ee 100644
@@ -29,6 +29,7 @@ SOBJS	:= lowlevel_init.o
 
 COBJS	+= board.o
 COBJS	+= clock.o
+COBJS	+= gpio.o
 COBJS	+= mem.o
 COBJS	+= syslib.o
 COBJS	+= sys_info.o
cpu/arm_cortexa8/omap3/gpio.c new file +185 -0

185 lines not on this page · raw message

doc/README.omap3 +32 -0
index 9ab0979..e05e816 100644
@@ -84,6 +84,38 @@ For all other commands see
 
 help
 
+Interfaces
+==========
+
+gpio
+
+To set a bit :
+
+	if (!omap_request_gpio(N)) {
+		omap_set_gpio_direction(N, 0);
+		omap_set_gpio_dataout(N, 1);
+	}
+
+To clear a bit :
+
+	if (!omap_request_gpio(N)) {
+		omap_set_gpio_direction(N, 0);
+		omap_set_gpio_dataout(N, 0);
+	}
+
+To read a bit :
+
+	if (!omap_request_gpio(N)) {
+		omap_set_gpio_direction(NULL, 1);
+		val = omap_get_gpio_datain(N);
+		omap_free_gpio(N);
+	}
+	if (val)
+		printf("GPIO N is set\n");
+	else
+		printf("GPIO N is clear\n");
+
+
 Acknowledgements
 ================
 
include/asm-arm/arch-omap3/gpio.h new file +86 -0

86 lines not on this page · raw message

Signature · 1 line
1.6.0.5
#1 lore raw

PATCH 3/6 OMAP3 Port kernel omap gpio interface.

Quoted 7 lines · Tom Rix

Port version 2.6.27 of the linux kernel's omap gpio interface to u-boot. The orignal source is in linux/arch/arm/plat-omap/gpio.c

See doc/README.omap3 for instructions on use.

---

Applied to arm/next

Best Regards,
J.