All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] OMAP3:EVM: remove direct gpio hits
@ 2009-09-24  1:02 Nishanth Menon
  0 siblings, 0 replies; only message in thread
From: Nishanth Menon @ 2009-09-24  1:02 UTC (permalink / raw)
  To: u-boot

ONLY COMPILE TESTED
replace gpio direct access with gpio api calls

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 board/ti/evm/evm.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 0718a08..f0ebaad 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -35,6 +35,7 @@
 #include <asm/arch/sys_proto.h>
 #include <i2c.h>
 #include <asm/mach-types.h>
+#include <asm/arch/gpio.h>
 #include "evm.h"
 
 /*
@@ -92,7 +93,6 @@ void set_muxconf_regs(void)
  */
 static void setup_net_chip(void)
 {
-	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
 	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
 
 	/* Configure GPMC registers */
@@ -112,15 +112,15 @@ static void setup_net_chip(void)
 	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
 		&ctrl_base->gpmc_nadv_ale);
 
-	/* Make GPIO 64 as output pin */
-	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
-
-	/* Now send a pulse on the GPIO pin */
-	writel(GPIO0, &gpio3_base->setdataout);
-	udelay(1);
-	writel(GPIO0, &gpio3_base->cleardataout);
-	udelay(1);
-	writel(GPIO0, &gpio3_base->setdataout);
+	/* Make GPIO 64 as output pin and send a magic pulse through it */
+	if (!omap_request_gpio(64)) {
+		omap_set_gpio_direction(64, 0);
+		omap_set_gpio_dataout(64, 1);
+		udelay(1);
+		omap_set_gpio_dataout(64, 0);
+		udelay(1);
+		omap_set_gpio_dataout(64, 1);
+	}
 }
 
 int board_eth_init(bd_t *bis)
-- 
1.6.0.4


--------------070100000504080108000804--

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-24  1:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-24  1:02 [PATCH] [RFC] OMAP3:EVM: remove direct gpio hits Nishanth Menon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.