diff options
author | Sanjeev Premi <premi@ti.com> | 2011-09-08 10:51:01 -0400 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2011-09-13 08:25:15 +0200 |
commit | 84c3b6312997de6f98114263159c8b9824f3d33d (patch) | |
tree | 943f816f64d66cd956b5ece9b6198b78b7c2c5e9 /board/ti/beagle/beagle.c | |
parent | 3b690ebbbf21303a3bac1f62d967c36cd8655ce0 (diff) | |
download | u-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/ti/beagle/beagle.c')
-rw-r--r-- | board/ti/beagle/beagle.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index e07f1b8..8cdceaf 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -38,7 +38,7 @@ #include <asm/arch/mmc_host_def.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> -#include <asm/arch/gpio.h> +#include <asm/gpio.h> #include <asm/mach-types.h> #ifdef CONFIG_USB_EHCI #include <usb.h> @@ -116,21 +116,21 @@ int get_board_revision(void) { int revision; - if (!omap_request_gpio(171) && - !omap_request_gpio(172) && - !omap_request_gpio(173)) { + if (!gpio_request(171, "") && + !gpio_request(172, "") && + !gpio_request(173, "")) { - omap_set_gpio_direction(171, 1); - omap_set_gpio_direction(172, 1); - omap_set_gpio_direction(173, 1); + gpio_direction_input(171); + gpio_direction_input(172); + gpio_direction_input(173); - revision = omap_get_gpio_datain(173) << 2 | - omap_get_gpio_datain(172) << 1 | - omap_get_gpio_datain(171); + revision = gpio_get_value(173) << 2 | + gpio_get_value(172) << 1 | + gpio_get_value(171); - omap_free_gpio(171); - omap_free_gpio(172); - omap_free_gpio(173); + gpio_free(171); + gpio_free(172); + gpio_free(173); } else { printf("Error: unable to acquire board revision GPIOs\n"); revision = -1; @@ -387,7 +387,7 @@ int board_mmc_init(bd_t *bis) int ehci_hcd_stop(void) { pr_debug("Resetting OMAP3 EHCI\n"); - omap_set_gpio_dataout(GPIO_PHY_RESET, 0); + gpio_set_value(GPIO_PHY_RESET, 0); writel(OMAP_UHH_SYSCONFIG_SOFTRESET, OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG); /* disable USB clocks */ struct prcm *prcm_base = (struct prcm *)PRCM_BASE; @@ -415,9 +415,9 @@ int ehci_hcd_init(void) pr_debug("Initializing OMAP3 ECHI\n"); /* Put the PHY in RESET */ - omap_request_gpio(GPIO_PHY_RESET); - omap_set_gpio_direction(GPIO_PHY_RESET, 0); - omap_set_gpio_dataout(GPIO_PHY_RESET, 0); + gpio_request(GPIO_PHY_RESET, ""); + gpio_direction_output(GPIO_PHY_RESET, 0); + gpio_set_value(GPIO_PHY_RESET, 0); /* Hold the PHY in RESET for enough time till DIR is high */ /* Refer: ISSUE1 */ @@ -469,7 +469,7 @@ int ehci_hcd_init(void) * PHY is settled and ready */ udelay(10); - omap_set_gpio_dataout(GPIO_PHY_RESET, 1); + gpio_set_value(GPIO_PHY_RESET, 1); hccr = (struct ehci_hccr *)(OMAP3_EHCI_BASE); hcor = (struct ehci_hcor *)(OMAP3_EHCI_BASE + 0x10); @@ -508,10 +508,10 @@ int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) gpio = 4; break; } - omap_request_gpio(gpio); - omap_set_gpio_direction(gpio, 1); + gpio_request(gpio, ""); + gpio_direction_input(gpio); printf("The user button is currently "); - if(omap_get_gpio_datain(gpio)) + if (gpio_get_value(gpio)) { button = 1; printf("PRESSED.\n"); @@ -522,7 +522,7 @@ int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf("NOT pressed.\n"); } - omap_free_gpio(gpio); + gpio_free(gpio); return !button; } |