Skip to content

Commit

Permalink
ARM: mmp: add usb device support for ttc dkb
Browse files Browse the repository at this point in the history
There is an U2O OTG controller on ttc dkb, this patch is going to enable
it.
At this moment, it can only works in device mode, because when works in
host mode, it needs to supply vbus, but we have no vbus driver added
at this moment. Once the vbus driver is added, I'll prepar another
patch to enable the switch function.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
  • Loading branch information
Neil Zhang authored and Haojian Zhuang committed May 3, 2012
1 parent 75b1bdf commit 673eef9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions arch/arm/mach-mmp/ttc_dkb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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"

Expand Down Expand Up @@ -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));
Expand All @@ -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")
Expand Down

0 comments on commit 673eef9

Please sign in to comment.