OMAP3:EVM: remove direct gpio hits
RFC PATCH 1/1 OMAP3:EVM: remove direct gpio hits
ONLY COMPILE TESTED
replace gpio direct access with gpio api calls
Signed-off-by Nishanth Menon <[email protected]>
--- board/ti/evm/evm.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
board/ti/evm/evm.c +10 -10
@@ -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)
Signature · 4 lines
1.6.0.4 --------------070100000504080108000804--