summaryrefslogtreecommitdiff
path: root/board/overo
diff options
context:
space:
mode:
authorSanjeev Premi <premi@ti.com>2011-09-08 10:51:01 -0400
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-09-13 08:25:15 +0200
commit84c3b6312997de6f98114263159c8b9824f3d33d (patch)
tree943f816f64d66cd956b5ece9b6198b78b7c2c5e9 /board/overo
parent3b690ebbbf21303a3bac1f62d967c36cd8655ce0 (diff)
downloadu-boot-imx-84c3b6312997de6f98114263159c8b9824f3d33d.zip
u-boot-imx-84c3b6312997de6f98114263159c8b9824f3d33d.tar.gz
u-boot-imx-84c3b6312997de6f98114263159c8b9824f3d33d.tar.bz2
omap: gpio: Adapt board files to use generic API
This patch contains updates the sources in the board files to use the generic API. Signed-off-by: Sanjeev Premi <premi@ti.com>
Diffstat (limited to 'board/overo')
-rw-r--r--board/overo/overo.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 4eafdb1..4bbe1b8 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -36,7 +36,7 @@
#include <asm/arch/mux.h>
#include <asm/arch/mem.h>
#include <asm/arch/sys_proto.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
#include <asm/mach-types.h>
#include "overo.h"
@@ -106,21 +106,21 @@ int get_board_revision(void)
{
int revision;
- if (!omap_request_gpio(112) &&
- !omap_request_gpio(113) &&
- !omap_request_gpio(115)) {
+ if (!gpio_request(112, "") &&
+ !gpio_request(113, "") &&
+ !gpio_request(115, "")) {
- omap_set_gpio_direction(112, 1);
- omap_set_gpio_direction(113, 1);
- omap_set_gpio_direction(115, 1);
+ gpio_direction_input(112);
+ gpio_direction_input(113);
+ gpio_direction_input(115);
- revision = omap_get_gpio_datain(115) << 2 |
- omap_get_gpio_datain(113) << 1 |
- omap_get_gpio_datain(112);
+ revision = gpio_get_value(115) << 2 |
+ gpio_get_value(113) << 1 |
+ gpio_get_value(112);
- omap_free_gpio(112);
- omap_free_gpio(113);
- omap_free_gpio(115);
+ gpio_free(112);
+ gpio_free(113);
+ gpio_free(115);
} else {
printf("Error: unable to acquire board revision GPIOs\n");
revision = -1;
@@ -139,21 +139,21 @@ int get_sdio2_config(void)
{
int sdio_direct;
- if (!omap_request_gpio(130) && !omap_request_gpio(139)) {
+ if (!gpio_request(130, "") && !gpio_request(139, "")) {
- omap_set_gpio_direction(130, 0);
- omap_set_gpio_direction(139, 1);
+ gpio_direction_output(130, 0);
+ gpio_direction_input(139);
sdio_direct = 1;
- omap_set_gpio_dataout(130, 0);
- if (omap_get_gpio_datain(139) == 0) {
- omap_set_gpio_dataout(130, 1);
- if (omap_get_gpio_datain(139) == 1)
+ gpio_set_value(130, 0);
+ if (gpio_get_value(139) == 0) {
+ gpio_set_value(130, 1);
+ if (gpio_get_value(139) == 1)
sdio_direct = 0;
}
- omap_free_gpio(130);
- omap_free_gpio(139);
+ gpio_free(130);
+ gpio_free(139);
} else {
printf("Error: unable to acquire sdio2 clk GPIOs\n");
sdio_direct = -1;
@@ -322,13 +322,13 @@ static void setup_net_chip(void)
&ctrl_base->gpmc_nadv_ale);
/* 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);
+ if (!gpio_request(64, "")) {
+ gpio_direction_output(64, 0);
+ gpio_set_value(64, 1);
udelay(1);
- omap_set_gpio_dataout(64, 0);
+ gpio_set_value(64, 0);
udelay(1);
- omap_set_gpio_dataout(64, 1);
+ gpio_set_value(64, 1);
}
}
#endif