Merge tag 'imx-eukrea' of git://git.pengutronix.de/git/imx/linux-2.6 into next/boards
[linux-2.6-block.git] / arch / arm / mach-mmp / ttc_dkb.c
index e72c709da44f3e2461e6817c504ed571b909fecd..266215393f44c9d3a84335d34804074211c5f74a 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/i2c/pca953x.h>
 #include <linux/gpio.h>
+#include <linux/platform_data/mv_usb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -25,6 +26,7 @@
 #include <mach/mfp-pxa910.h>
 #include <mach/pxa910.h>
 #include <mach/irqs.h>
+#include <mach/regs-usb.h>
 
 #include "common.h"
 
@@ -38,7 +40,7 @@
  * 16 board interrupts -- PCA9575 GPIO expander
  * 24 board interrupts -- 88PM860x PMIC
  */
-#define TTCDKB_NR_IRQS         (IRQ_BOARD_START + 16 + 16 + 24)
+#define TTCDKB_NR_IRQS         (MMP_NR_IRQS + 16 + 16 + 24)
 
 static unsigned long ttc_dkb_pin_config[] __initdata = {
        /* UART2 */
@@ -131,7 +133,7 @@ static struct platform_device *ttc_dkb_devices[] = {
 static struct pca953x_platform_data max7312_data[] = {
        {
                .gpio_base      = TTCDKB_GPIO_EXT0(0),
-               .irq_base       = IRQ_BOARD_START,
+               .irq_base       = MMP_NR_IRQS,
        },
 };
 
@@ -144,6 +146,26 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
        },
 };
 
+#ifdef CONFIG_USB_SUPPORT
+#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
+
+static char *pxa910_usb_clock_name[] = {
+       [0] = "U2OCLK",
+};
+
+static struct mv_usb_platform_data ttc_usb_pdata = {
+       .clknum         = 1,
+       .clkname        = pxa910_usb_clock_name,
+       .vbus           = NULL,
+       .mode           = MV_USB_MODE_OTG,
+       .otg_force_a_bus_req = 1,
+       .phy_init       = pxa_usb_phy_init,
+       .phy_deinit     = pxa_usb_phy_deinit,
+       .set_vbus       = NULL,
+};
+#endif
+#endif
+
 static void __init ttc_dkb_init(void)
 {
        mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -154,6 +176,21 @@ static void __init ttc_dkb_init(void)
        /* off-chip devices */
        pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
        platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
+
+#ifdef CONFIG_USB_MV_UDC
+       pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
+       platform_device_register(&pxa168_device_u2o);
+#endif
+
+#ifdef CONFIG_USB_EHCI_MV_U2O
+       pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
+       platform_device_register(&pxa168_device_u2oehci);
+#endif
+
+#ifdef CONFIG_USB_MV_OTG
+       pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
+       platform_device_register(&pxa168_device_u2ootg);
+#endif
 }
 
 MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")