From 84c3b6312997de6f98114263159c8b9824f3d33d Mon Sep 17 00:00:00 2001 From: Sanjeev Premi Date: Thu, 8 Sep 2011 10:51:01 -0400 Subject: 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 --- board/ti/beagle/beagle.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'board/ti/beagle/beagle.c') 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 #include #include -#include +#include #include #ifdef CONFIG_USB_EHCI #include @@ -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; } -- cgit v1.1