aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard-smartbot.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-05-20 18:43:18 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-20 18:43:18 -0400
commit9bfe99a8f95122f83f3c894b1071b61e2b6d4990 (patch)
treee322752b04deb314b579cae2c5c9993453775823 /arch/arm/mach-mx3/mx31moboard-smartbot.c
parentf72caf7e496465182eeda842ac66a5e75404ddf1 (diff)
parent54c1f6367c2836a85e821a010085ed04ab2235bc (diff)
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable
Diffstat (limited to 'arch/arm/mach-mx3/mx31moboard-smartbot.c')
-rw-r--r--arch/arm/mach-mx3/mx31moboard-smartbot.c53
1 files changed, 48 insertions, 5 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
index 52a69fc8b14f..293eea6d9d97 100644
--- a/arch/arm/mach-mx3/mx31moboard-smartbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -23,11 +23,18 @@
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/fsl_devices.h>
27
28#include <linux/usb/otg.h>
29#include <linux/usb/ulpi.h>
26 30
27#include <mach/common.h> 31#include <mach/common.h>
28#include <mach/hardware.h> 32#include <mach/hardware.h>
29#include <mach/imx-uart.h> 33#include <mach/imx-uart.h>
30#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>
31 38
32#include <media/soc_camera.h> 39#include <media/soc_camera.h>
33 40
@@ -116,10 +123,33 @@ static int __init smartbot_cam_init(void)
116 return 0; 123 return 0;
117} 124}
118 125
126static struct fsl_usb2_platform_data usb_pdata = {
127 .operating_mode = FSL_USB2_DR_DEVICE,
128 .phy_mode = FSL_USB2_PHY_ULPI,
129};
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
119#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1) 149#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
120#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1) 150#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
121#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1) 151#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
122#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1) 152#define TRSLAT_SRC_CHOICE IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
123 153
124static void smartbot_resets_init(void) 154static void smartbot_resets_init(void)
125{ 155{
@@ -138,15 +168,15 @@ static void smartbot_resets_init(void)
138 gpio_export(TRSLAT_RST_B, false); 168 gpio_export(TRSLAT_RST_B, false);
139 } 169 }
140 170
141 if (!gpio_request(SEL3, "sel3")) { 171 if (!gpio_request(TRSLAT_SRC_CHOICE, "translator-src-choice")) {
142 gpio_direction_input(SEL3); 172 gpio_direction_output(TRSLAT_SRC_CHOICE, 0);
143 gpio_export(SEL3, true); 173 gpio_export(TRSLAT_SRC_CHOICE, false);
144 } 174 }
145} 175}
146/* 176/*
147 * system init for baseboard usage. Will be called by mx31moboard init. 177 * system init for baseboard usage. Will be called by mx31moboard init.
148 */ 178 */
149void __init mx31moboard_smartbot_init(void) 179void __init mx31moboard_smartbot_init(int board)
150{ 180{
151 printk(KERN_INFO "Initializing mx31smartbot peripherals\n"); 181 printk(KERN_INFO "Initializing mx31smartbot peripherals\n");
152 182
@@ -155,6 +185,19 @@ void __init mx31moboard_smartbot_init(void)
155 185
156 mxc_register_device(&mxc_uart_device1, &uart_pdata); 186 mxc_register_device(&mxc_uart_device1, &uart_pdata);
157 187
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 }
200
158 smartbot_resets_init(); 201 smartbot_resets_init();
159 202
160 smartbot_cam_init(); 203 smartbot_cam_init();