aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard-smartbot.c
diff options
context:
space:
mode:
authorPhilippe Rétornaz <philippe.retornaz@epfl.ch>2010-05-11 10:57:51 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-05-17 04:05:50 -0400
commit3a47b1a4f16285bc1b96941782a896afc4711e97 (patch)
tree8eba928f94d2be078c137fcb456247e91744b164 /arch/arm/mach-mx3/mx31moboard-smartbot.c
parent66c202ad9a58905e0e6a0fa3976020a7ab0fa6df (diff)
mx31moboard: OTG host support for smartbot board
The Eyebot robot needs the OTG port in host mode on the smartbot. Add a new board definition so we can select the usb host/device mode at boot with the mx31moboard_baseboard boot parameter. Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mx31moboard-smartbot.c')
-rw-r--r--arch/arm/mach-mx3/mx31moboard-smartbot.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
index ac1a163a5b78..293eea6d9d97 100644
--- a/arch/arm/mach-mx3/mx31moboard-smartbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -25,10 +25,16 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/fsl_devices.h> 26#include <linux/fsl_devices.h>
27 27
28#include <linux/usb/otg.h>
29#include <linux/usb/ulpi.h>
30
28#include <mach/common.h> 31#include <mach/common.h>
29#include <mach/hardware.h> 32#include <mach/hardware.h>
30#include <mach/imx-uart.h> 33#include <mach/imx-uart.h>
31#include <mach/iomux-mx3.h> 34#include <mach/iomux-mx3.h>
35#include <mach/board-mx31moboard.h>
36#include <mach/mxc_ehci.h>
37#include <mach/ulpi.h>
32 38
33#include <media/soc_camera.h> 39#include <media/soc_camera.h>
34 40
@@ -122,6 +128,24 @@ static struct fsl_usb2_platform_data usb_pdata = {
122 .phy_mode = FSL_USB2_PHY_ULPI, 128 .phy_mode = FSL_USB2_PHY_ULPI,
123}; 129};
124 130
131#if defined(CONFIG_USB_ULPI)
132
133static struct mxc_usbh_platform_data otg_host_pdata = {
134 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
135 .flags = MXC_EHCI_POWER_PINS_ENABLED,
136};
137
138static int __init smartbot_otg_host_init(void)
139{
140 otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
141 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
142
143 return mxc_register_device(&mxc_otg_host, &otg_host_pdata);
144}
145#else
146static inline int smartbot_otg_host_init(void) { return 0; }
147#endif
148
125#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1) 149#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
126#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1) 150#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
127#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1) 151#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
@@ -152,7 +176,7 @@ static void smartbot_resets_init(void)
152/* 176/*
153 * system init for baseboard usage. Will be called by mx31moboard init. 177 * system init for baseboard usage. Will be called by mx31moboard init.
154 */ 178 */
155void __init mx31moboard_smartbot_init(void) 179void __init mx31moboard_smartbot_init(int board)
156{ 180{
157 printk(KERN_INFO "Initializing mx31smartbot peripherals\n"); 181 printk(KERN_INFO "Initializing mx31smartbot peripherals\n");
158 182
@@ -161,7 +185,18 @@ void __init mx31moboard_smartbot_init(void)
161 185
162 mxc_register_device(&mxc_uart_device1, &uart_pdata); 186 mxc_register_device(&mxc_uart_device1, &uart_pdata);
163 187
164 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 188
189 switch (board) {
190 case MX31SMARTBOT:
191 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
192 break;
193 case MX31EYEBOT:
194 smartbot_otg_host_init();
195 break;
196 default:
197 printk(KERN_WARNING "Unknown board %d, USB OTG not initialized",
198 board);
199 }
165 200
166 smartbot_resets_init(); 201 smartbot_resets_init();
167 202