Commit bb706b28 authored by Manuel Lauss's avatar Manuel Lauss Committed by Ralf Baechle

MIPS: Alchemy: MTX-1: Use linux gpio api.

Replace a few GPIO register accesses in the board init code with calls
to the gpio api.
Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 51e02b02
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* 675 Mass Ave, Cambridge, MA 02139, USA. * 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/gpio.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1000.h>
...@@ -55,10 +56,11 @@ void __init board_setup(void) ...@@ -55,10 +56,11 @@ void __init board_setup(void)
} }
#endif #endif
alchemy_gpio2_enable();
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
/* Enable USB power switch */ /* Enable USB power switch */
au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); alchemy_gpio_direction_output(204, 0);
au_writel(0x100000, GPIO2_OUTPUT);
#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ #endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -74,14 +76,14 @@ void __init board_setup(void) ...@@ -74,14 +76,14 @@ void __init board_setup(void)
/* Initialize GPIO */ /* Initialize GPIO */
au_writel(0xFFFFFFFF, SYS_TRIOUTCLR); au_writel(0xFFFFFFFF, SYS_TRIOUTCLR);
au_writel(0x00000001, SYS_OUTPUTCLR); /* set M66EN (PCI 66MHz) to OFF */ alchemy_gpio_direction_output(0, 0); /* Disable M66EN (PCI 66MHz) */
au_writel(0x00000008, SYS_OUTPUTSET); /* set PCI CLKRUN# to OFF */ alchemy_gpio_direction_output(3, 1); /* Disable PCI CLKRUN# */
au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ alchemy_gpio_direction_output(1, 1); /* Enable EXT_IO3 */
au_writel(0x00000020, SYS_OUTPUTCLR); /* set eth PHY TX_ER to OFF */ alchemy_gpio_direction_output(5, 0); /* Disable eth PHY TX_ER */
/* Enable LED and set it to green */ /* Enable LED and set it to green */
au_writel(au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR); alchemy_gpio_direction_output(211, 1); /* green on */
au_writel(0x18000800, GPIO2_OUTPUT); alchemy_gpio_direction_output(212, 0); /* red off */
board_pci_idsel = mtx1_pci_idsel; board_pci_idsel = mtx1_pci_idsel;
...@@ -101,10 +103,10 @@ mtx1_pci_idsel(unsigned int devsel, int assert) ...@@ -101,10 +103,10 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
if (assert && devsel != 0) if (assert && devsel != 0)
/* Suppress signal to Cardbus */ /* Suppress signal to Cardbus */
au_writel(0x00000002, SYS_OUTPUTCLR); /* set EXT_IO3 OFF */ gpio_set_value(1, 0); /* set EXT_IO3 OFF */
else else
au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ gpio_set_value(1, 1); /* set EXT_IO3 ON */
au_sync_udelay(1); au_sync_udelay(1);
return 1; return 1;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment