From 42e07ad7fc111bde5cd6c0e5bd7085b4cecf96b7 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@caiaq.de>
Date: Fri, 13 Mar 2009 16:37:11 +0100
Subject: [ARM] pxa: add USB support for Colibri PXA300

This adds support for USB OHCI for Toradex' Colibri PXA300 modules as
connected on the evaluation board.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
---
 arch/arm/mach-pxa/colibri-pxa300.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'arch')

diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 7cc4249c7701..f1f24869c03d 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -22,6 +22,7 @@
 #include <mach/pxa300.h>
 #include <mach/colibri.h>
 #include <mach/mmc.h>
+#include <mach/ohci.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -41,6 +42,11 @@ static mfp_cfg_t colibri_pxa300_pin_config[] __initdata = {
 	GPIO5_MMC1_DAT2,
 	GPIO6_MMC1_DAT3,
 #endif
+
+#if defined (CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+        GPIO0_2_USBH_PEN,
+        GPIO1_2_USBH_PWR,
+#endif
 };
 
 #if defined(CONFIG_AX88796)
@@ -137,12 +143,27 @@ static void __init colibri_pxa300_init_mmc(void)
 static inline void colibri_pxa300_init_mmc(void) {}
 #endif /* CONFIG_MMC_PXA */
 
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
+	.port_mode	= PMM_GLOBAL_MODE,
+	.flags		= ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
+};
+
+static void __init colibri_pxa300_init_ohci(void)
+{
+	pxa_set_ohci_info(&colibri_pxa300_ohci_info);
+}
+#else
+static inline void colibri_pxa300_init_ohci(void) {}
+#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
+
 static void __init colibri_pxa300_init(void)
 {
 	set_irq_type(COLIBRI_PXA300_ETH_IRQ, IRQ_TYPE_EDGE_FALLING);
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_pin_config));
 	platform_add_devices(ARRAY_AND_SIZE(colibri_pxa300_devices));
 	colibri_pxa300_init_mmc();
+	colibri_pxa300_init_ohci();
 }
 
 MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
-- 
cgit v1.2.3