aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mach-mx31_3ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx3/mach-mx31_3ds.c')
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index c488491bf938..fd7b722dff63 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -22,6 +22,8 @@
22#include <linux/mfd/mc13783.h> 22#include <linux/mfd/mc13783.h>
23#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
24#include <linux/regulator/machine.h> 24#include <linux/regulator/machine.h>
25#include <linux/usb/otg.h>
26#include <linux/usb/ulpi.h>
25 27
26#include <mach/hardware.h> 28#include <mach/hardware.h>
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -32,6 +34,7 @@
32#include <mach/common.h> 34#include <mach/common.h>
33#include <mach/iomux-mx3.h> 35#include <mach/iomux-mx3.h>
34#include <mach/3ds_debugboard.h> 36#include <mach/3ds_debugboard.h>
37#include <mach/ulpi.h>
35 38
36#include "devices-imx31.h" 39#include "devices-imx31.h"
37#include "devices.h" 40#include "devices.h"
@@ -212,11 +215,33 @@ usbotg_free_reset:
212 return err; 215 return err;
213} 216}
214 217
218#if defined(CONFIG_USB_ULPI)
219static struct mxc_usbh_platform_data otg_pdata __initdata = {
220 .portsc = MXC_EHCI_MODE_ULPI,
221 .flags = MXC_EHCI_POWER_PINS_ENABLED,
222};
223#endif
224
215static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { 225static const struct fsl_usb2_platform_data usbotg_pdata __initconst = {
216 .operating_mode = FSL_USB2_DR_DEVICE, 226 .operating_mode = FSL_USB2_DR_DEVICE,
217 .phy_mode = FSL_USB2_PHY_ULPI, 227 .phy_mode = FSL_USB2_PHY_ULPI,
218}; 228};
219 229
230static int otg_mode_host;
231
232static int __init mx31_3ds_otg_mode(char *options)
233{
234 if (!strcmp(options, "host"))
235 otg_mode_host = 1;
236 else if (!strcmp(options, "device"))
237 otg_mode_host = 0;
238 else
239 pr_info("otg_mode neither \"host\" nor \"device\". "
240 "Defaulting to device\n");
241 return 0;
242}
243__setup("otg_mode=", mx31_3ds_otg_mode);
244
220static const struct imxuart_platform_data uart_pdata __initconst = { 245static const struct imxuart_platform_data uart_pdata __initconst = {
221 .flags = IMXUART_HAVE_RTSCTS, 246 .flags = IMXUART_HAVE_RTSCTS,
222}; 247};
@@ -247,7 +272,16 @@ static void __init mxc_board_init(void)
247 imx31_add_imx_keypad(&mx31_3ds_keymap_data); 272 imx31_add_imx_keypad(&mx31_3ds_keymap_data);
248 273
249 mx31_3ds_usbotg_init(); 274 mx31_3ds_usbotg_init();
250 imx31_add_fsl_usb2_udc(&usbotg_pdata); 275#if defined(CONFIG_USB_ULPI)
276 if (otg_mode_host) {
277 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
278 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
279
280 imx31_add_mxc_ehci_otg(&otg_pdata);
281 }
282#endif
283 if (!otg_mode_host)
284 imx31_add_fsl_usb2_udc(&usbotg_pdata);
251 285
252 if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 286 if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT))
253 printk(KERN_WARNING "Init of the debug board failed, all " 287 printk(KERN_WARNING "Init of the debug board failed, all "