aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2012-05-03 02:19:14 -0400
committerHaojian Zhuang <haojian.zhuang@gmail.com>2012-05-03 03:05:39 -0400
commit673eef981436ffb015f491e2c58b83b2015ed878 (patch)
tree04d6db8614de50911031ee7ca6ccd852d47694a4 /arch
parent75b1bdf51c4b5c383296de2df9ad83b1b8dd287f (diff)
ARM: mmp: add usb device support for ttc dkb
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 3fc9ed21f97d..266215393f44 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -17,6 +17,7 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/i2c/pca953x.h> 18#include <linux/i2c/pca953x.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/mv_usb.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -25,6 +26,7 @@
25#include <mach/mfp-pxa910.h> 26#include <mach/mfp-pxa910.h>
26#include <mach/pxa910.h> 27#include <mach/pxa910.h>
27#include <mach/irqs.h> 28#include <mach/irqs.h>
29#include <mach/regs-usb.h>
28 30
29#include "common.h" 31#include "common.h"
30 32
@@ -144,6 +146,26 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
144 }, 146 },
145}; 147};
146 148
149#ifdef CONFIG_USB_SUPPORT
150#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
151
152static char *pxa910_usb_clock_name[] = {
153 [0] = "U2OCLK",
154};
155
156static struct mv_usb_platform_data ttc_usb_pdata = {
157 .clknum = 1,
158 .clkname = pxa910_usb_clock_name,
159 .vbus = NULL,
160 .mode = MV_USB_MODE_OTG,
161 .otg_force_a_bus_req = 1,
162 .phy_init = pxa_usb_phy_init,
163 .phy_deinit = pxa_usb_phy_deinit,
164 .set_vbus = NULL,
165};
166#endif
167#endif
168
147static void __init ttc_dkb_init(void) 169static void __init ttc_dkb_init(void)
148{ 170{
149 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); 171 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -154,6 +176,21 @@ static void __init ttc_dkb_init(void)
154 /* off-chip devices */ 176 /* off-chip devices */
155 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); 177 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
156 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); 178 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
179
180#ifdef CONFIG_USB_MV_UDC
181 pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
182 platform_device_register(&pxa168_device_u2o);
183#endif
184
185#ifdef CONFIG_USB_EHCI_MV_U2O
186 pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
187 platform_device_register(&pxa168_device_u2oehci);
188#endif
189
190#ifdef CONFIG_USB_MV_OTG
191 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
192 platform_device_register(&pxa168_device_u2ootg);
193#endif
157} 194}
158 195
159MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 196MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")