diff options
-rw-r--r-- | arch/arm/mach-imx/mach-cpuimx27.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pca100.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-armadillo5x0.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31_3ds.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31lilly.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31lite.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31moboard.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm037.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm043.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-smartbot.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikasb.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-mx5/mx51_efika.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/ulpi.h | 9 | ||||
-rw-r--r-- | arch/arm/plat-mxc/ulpi.c | 5 |
15 files changed, 94 insertions, 109 deletions
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 6b724c2ed0a7..759299bb035b 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -209,7 +209,6 @@ static struct platform_device serial_device = { | |||
209 | }; | 209 | }; |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | #if defined(CONFIG_USB_ULPI) | ||
213 | static int eukrea_cpuimx27_otg_init(struct platform_device *pdev) | 212 | static int eukrea_cpuimx27_otg_init(struct platform_device *pdev) |
214 | { | 213 | { |
215 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | 214 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); |
@@ -229,7 +228,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
229 | .init = eukrea_cpuimx27_usbh2_init, | 228 | .init = eukrea_cpuimx27_usbh2_init, |
230 | .portsc = MXC_EHCI_MODE_ULPI, | 229 | .portsc = MXC_EHCI_MODE_ULPI, |
231 | }; | 230 | }; |
232 | #endif | ||
233 | 231 | ||
234 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 232 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
235 | .operating_mode = FSL_USB2_DR_DEVICE, | 233 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -283,21 +281,19 @@ static void __init eukrea_cpuimx27_init(void) | |||
283 | platform_device_register(&serial_device); | 281 | platform_device_register(&serial_device); |
284 | #endif | 282 | #endif |
285 | 283 | ||
286 | #if defined(CONFIG_USB_ULPI) | ||
287 | if (otg_mode_host) { | 284 | if (otg_mode_host) { |
288 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 285 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
289 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 286 | ULPI_OTG_DRVVBUS_EXT); |
290 | 287 | if (otg_pdata.otg) | |
291 | imx27_add_mxc_ehci_otg(&otg_pdata); | 288 | imx27_add_mxc_ehci_otg(&otg_pdata); |
289 | } else { | ||
290 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | ||
292 | } | 291 | } |
293 | 292 | ||
294 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 293 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
295 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 294 | ULPI_OTG_DRVVBUS_EXT); |
296 | 295 | if (usbh2_pdata.otg) | |
297 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); | 296 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
298 | #endif | ||
299 | if (!otg_mode_host) | ||
300 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | ||
301 | 297 | ||
302 | #ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD | 298 | #ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD |
303 | eukrea_mbimx27_baseboard_init(); | 299 | eukrea_mbimx27_baseboard_init(); |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index f4f2725b6945..614b3c00c4a0 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -162,7 +162,6 @@ static int otg_phy_init(void) | |||
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
164 | 164 | ||
165 | #if defined(CONFIG_USB_ULPI) | ||
166 | static int mx27_3ds_otg_init(struct platform_device *pdev) | 165 | static int mx27_3ds_otg_init(struct platform_device *pdev) |
167 | { | 166 | { |
168 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | 167 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); |
@@ -172,7 +171,6 @@ static struct mxc_usbh_platform_data otg_pdata __initdata = { | |||
172 | .init = mx27_3ds_otg_init, | 171 | .init = mx27_3ds_otg_init, |
173 | .portsc = MXC_EHCI_MODE_ULPI, | 172 | .portsc = MXC_EHCI_MODE_ULPI, |
174 | }; | 173 | }; |
175 | #endif | ||
176 | 174 | ||
177 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 175 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
178 | .operating_mode = FSL_USB2_DR_DEVICE, | 176 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -275,14 +273,15 @@ static void __init mx27pdk_init(void) | |||
275 | imx27_add_mxc_mmc(0, &sdhc1_pdata); | 273 | imx27_add_mxc_mmc(0, &sdhc1_pdata); |
276 | imx27_add_imx2_wdt(NULL); | 274 | imx27_add_imx2_wdt(NULL); |
277 | otg_phy_init(); | 275 | otg_phy_init(); |
278 | #if defined(CONFIG_USB_ULPI) | 276 | |
279 | if (otg_mode_host) { | 277 | if (otg_mode_host) { |
280 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 278 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
281 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 279 | ULPI_OTG_DRVVBUS_EXT); |
282 | 280 | ||
283 | imx27_add_mxc_ehci_otg(&otg_pdata); | 281 | if (otg_pdata.otg) |
282 | imx27_add_mxc_ehci_otg(&otg_pdata); | ||
284 | } | 283 | } |
285 | #endif | 284 | |
286 | if (!otg_mode_host) | 285 | if (!otg_mode_host) |
287 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | 286 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
288 | 287 | ||
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index f754bab040b6..63e182556778 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -267,7 +267,6 @@ static const struct imxmmc_platform_data sdhc_pdata __initconst = { | |||
267 | .exit = pca100_sdhc2_exit, | 267 | .exit = pca100_sdhc2_exit, |
268 | }; | 268 | }; |
269 | 269 | ||
270 | #if defined(CONFIG_USB_ULPI) | ||
271 | static int otg_phy_init(struct platform_device *pdev) | 270 | static int otg_phy_init(struct platform_device *pdev) |
272 | { | 271 | { |
273 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | 272 | gpio_set_value(OTG_PHY_CS_GPIO, 0); |
@@ -295,7 +294,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
295 | .init = usbh2_phy_init, | 294 | .init = usbh2_phy_init, |
296 | .portsc = MXC_EHCI_MODE_ULPI, | 295 | .portsc = MXC_EHCI_MODE_ULPI, |
297 | }; | 296 | }; |
298 | #endif | ||
299 | 297 | ||
300 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 298 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
301 | .operating_mode = FSL_USB2_DR_DEVICE, | 299 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -402,23 +400,22 @@ static void __init pca100_init(void) | |||
402 | gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); | 400 | gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); |
403 | gpio_direction_output(USBH2_PHY_CS_GPIO, 1); | 401 | gpio_direction_output(USBH2_PHY_CS_GPIO, 1); |
404 | 402 | ||
405 | #if defined(CONFIG_USB_ULPI) | ||
406 | if (otg_mode_host) { | 403 | if (otg_mode_host) { |
407 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 404 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
408 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 405 | ULPI_OTG_DRVVBUS_EXT); |
409 | 406 | ||
410 | imx27_add_mxc_ehci_otg(&otg_pdata); | 407 | if (otg_pdata.otg) |
408 | imx27_add_mxc_ehci_otg(&otg_pdata); | ||
409 | } else { | ||
410 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | ||
411 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | ||
411 | } | 412 | } |
412 | 413 | ||
413 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 414 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
414 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 415 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
415 | 416 | ||
416 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); | 417 | if (usbh2_pdata.otg) |
417 | #endif | 418 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
418 | if (!otg_mode_host) { | ||
419 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | ||
420 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | ||
421 | } | ||
422 | 419 | ||
423 | imx27_add_imx_fb(&pca100_fb_data); | 420 | imx27_add_imx_fb(&pca100_fb_data); |
424 | 421 | ||
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c index 34e619e811e6..226829bf7c25 100644 --- a/arch/arm/mach-mx3/mach-armadillo5x0.c +++ b/arch/arm/mach-mx3/mach-armadillo5x0.c | |||
@@ -133,7 +133,6 @@ static int armadillo5x0_pins[] = { | |||
133 | }; | 133 | }; |
134 | 134 | ||
135 | /* USB */ | 135 | /* USB */ |
136 | #if defined(CONFIG_USB_ULPI) | ||
137 | 136 | ||
138 | #define OTG_RESET IOMUX_TO_GPIO(MX31_PIN_STXD4) | 137 | #define OTG_RESET IOMUX_TO_GPIO(MX31_PIN_STXD4) |
139 | #define USBH2_RESET IOMUX_TO_GPIO(MX31_PIN_SCK6) | 138 | #define USBH2_RESET IOMUX_TO_GPIO(MX31_PIN_SCK6) |
@@ -256,7 +255,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
256 | .init = usbh2_init, | 255 | .init = usbh2_init, |
257 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 256 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
258 | }; | 257 | }; |
259 | #endif /* CONFIG_USB_ULPI */ | ||
260 | 258 | ||
261 | /* RTC over I2C*/ | 259 | /* RTC over I2C*/ |
262 | #define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) | 260 | #define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) |
@@ -549,15 +547,15 @@ static void __init armadillo5x0_init(void) | |||
549 | i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); | 547 | i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); |
550 | 548 | ||
551 | /* USB */ | 549 | /* USB */ |
552 | #if defined(CONFIG_USB_ULPI) | 550 | |
553 | usbotg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 551 | usbotg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
554 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 552 | ULPI_OTG_DRVVBUS_EXT); |
555 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 553 | if (usbotg_pdata.otg) |
556 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 554 | imx31_add_mxc_ehci_otg(&usbotg_pdata); |
557 | 555 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | | |
558 | imx31_add_mxc_ehci_otg(&usbotg_pdata); | 556 | ULPI_OTG_DRVVBUS_EXT); |
559 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | 557 | if (usbh2_pdata.otg) |
560 | #endif | 558 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
561 | } | 559 | } |
562 | 560 | ||
563 | static void __init armadillo5x0_timer_init(void) | 561 | static void __init armadillo5x0_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index 35fdb2aeeaa3..f1dbb9d4a84d 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -244,7 +244,6 @@ usbotg_free_reset: | |||
244 | return err; | 244 | return err; |
245 | } | 245 | } |
246 | 246 | ||
247 | #if defined(CONFIG_USB_ULPI) | ||
248 | static int mx31_3ds_otg_init(struct platform_device *pdev) | 247 | static int mx31_3ds_otg_init(struct platform_device *pdev) |
249 | { | 248 | { |
250 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | 249 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); |
@@ -300,7 +299,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
300 | .init = mx31_3ds_host2_init, | 299 | .init = mx31_3ds_host2_init, |
301 | .portsc = MXC_EHCI_MODE_ULPI, | 300 | .portsc = MXC_EHCI_MODE_ULPI, |
302 | }; | 301 | }; |
303 | #endif | ||
304 | 302 | ||
305 | static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { | 303 | static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { |
306 | .operating_mode = FSL_USB2_DR_DEVICE, | 304 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -345,17 +343,17 @@ static void __init mx31_3ds_init(void) | |||
345 | imx31_add_imx_keypad(&mx31_3ds_keymap_data); | 343 | imx31_add_imx_keypad(&mx31_3ds_keymap_data); |
346 | 344 | ||
347 | mx31_3ds_usbotg_init(); | 345 | mx31_3ds_usbotg_init(); |
348 | #if defined(CONFIG_USB_ULPI) | ||
349 | if (otg_mode_host) { | 346 | if (otg_mode_host) { |
350 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 347 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
351 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 348 | ULPI_OTG_DRVVBUS_EXT); |
352 | 349 | if (otg_pdata.otg) | |
353 | imx31_add_mxc_ehci_otg(&otg_pdata); | 350 | imx31_add_mxc_ehci_otg(&otg_pdata); |
354 | } | 351 | } |
355 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 352 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
356 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 353 | ULPI_OTG_DRVVBUS_EXT); |
357 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | 354 | if (usbh2_pdata.otg) |
358 | #endif | 355 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
356 | |||
359 | if (!otg_mode_host) | 357 | if (!otg_mode_host) |
360 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | 358 | imx31_add_fsl_usb2_udc(&usbotg_pdata); |
361 | 359 | ||
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index e2f9de10ad9f..ed95745163b8 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -111,8 +111,6 @@ static struct platform_device physmap_flash_device = { | |||
111 | 111 | ||
112 | /* USB */ | 112 | /* USB */ |
113 | 113 | ||
114 | #if defined(CONFIG_USB_ULPI) | ||
115 | |||
116 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | 114 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
117 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 115 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
118 | 116 | ||
@@ -197,16 +195,13 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
197 | 195 | ||
198 | static void lilly1131_usb_init(void) | 196 | static void lilly1131_usb_init(void) |
199 | { | 197 | { |
200 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
201 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
202 | |||
203 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); | 198 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
204 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
205 | } | ||
206 | 199 | ||
207 | #else | 200 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
208 | static inline void lilly1131_usb_init(void) {} | 201 | ULPI_OTG_DRVVBUS_EXT); |
209 | #endif /* CONFIG_USB_ULPI */ | 202 | if (usbh2_pdata.otg) |
203 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
204 | } | ||
210 | 205 | ||
211 | /* SPI */ | 206 | /* SPI */ |
212 | 207 | ||
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c index 81021bf8f6b3..24a21a384bf1 100644 --- a/arch/arm/mach-mx3/mach-mx31lite.c +++ b/arch/arm/mach-mx3/mach-mx31lite.c | |||
@@ -130,7 +130,6 @@ static struct spi_board_info mc13783_spi_dev __initdata = { | |||
130 | * USB | 130 | * USB |
131 | */ | 131 | */ |
132 | 132 | ||
133 | #if defined(CONFIG_USB_ULPI) | ||
134 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | 133 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
135 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 134 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
136 | 135 | ||
@@ -177,7 +176,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
177 | .init = usbh2_init, | 176 | .init = usbh2_init, |
178 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 177 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
179 | }; | 178 | }; |
180 | #endif | ||
181 | 179 | ||
182 | /* | 180 | /* |
183 | * NOR flash | 181 | * NOR flash |
@@ -254,13 +252,11 @@ static void __init mx31lite_init(void) | |||
254 | imx31_add_spi_imx1(&spi1_pdata); | 252 | imx31_add_spi_imx1(&spi1_pdata); |
255 | spi_register_board_info(&mc13783_spi_dev, 1); | 253 | spi_register_board_info(&mc13783_spi_dev, 1); |
256 | 254 | ||
257 | #if defined(CONFIG_USB_ULPI) | ||
258 | /* USB */ | 255 | /* USB */ |
259 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 256 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
260 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 257 | ULPI_OTG_DRVVBUS_EXT); |
261 | 258 | if (usbh2_pdata.otg) | |
262 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | 259 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
263 | #endif | ||
264 | 260 | ||
265 | /* SMSC9117 IRQ pin */ | 261 | /* SMSC9117 IRQ pin */ |
266 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); | 262 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); |
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index 845d0b6b2539..6f3692bccb8a 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
@@ -400,7 +400,6 @@ static void usb_xcvr_reset(void) | |||
400 | mdelay(1); | 400 | mdelay(1); |
401 | } | 401 | } |
402 | 402 | ||
403 | #if defined(CONFIG_USB_ULPI) | ||
404 | static int moboard_usbh2_init_hw(struct platform_device *pdev) | 403 | static int moboard_usbh2_init_hw(struct platform_device *pdev) |
405 | { | 404 | { |
406 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | 405 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); |
@@ -415,8 +414,10 @@ static int __init moboard_usbh2_init(void) | |||
415 | { | 414 | { |
416 | struct platform_device *pdev; | 415 | struct platform_device *pdev; |
417 | 416 | ||
418 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 417 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
419 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 418 | ULPI_OTG_DRVVBUS_EXT); |
419 | if (!usbh2_pdata.otg) | ||
420 | return -ENODEV; | ||
420 | 421 | ||
421 | pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | 422 | pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
422 | if (IS_ERR(pdev)) | 423 | if (IS_ERR(pdev)) |
@@ -424,10 +425,6 @@ static int __init moboard_usbh2_init(void) | |||
424 | 425 | ||
425 | return 0; | 426 | return 0; |
426 | } | 427 | } |
427 | #else | ||
428 | static inline int moboard_usbh2_init(void) { return 0; } | ||
429 | #endif | ||
430 | |||
431 | 428 | ||
432 | static struct gpio_led mx31moboard_leds[] = { | 429 | static struct gpio_led mx31moboard_leds[] = { |
433 | { | 430 | { |
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c index 783d31b8e8a7..f07d3bded674 100644 --- a/arch/arm/mach-mx3/mach-pcm037.c +++ b/arch/arm/mach-mx3/mach-pcm037.c | |||
@@ -533,7 +533,6 @@ static struct platform_device pcm970_sja1000 = { | |||
533 | .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), | 533 | .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), |
534 | }; | 534 | }; |
535 | 535 | ||
536 | #if defined(CONFIG_USB_ULPI) | ||
537 | static int pcm037_otg_init(struct platform_device *pdev) | 536 | static int pcm037_otg_init(struct platform_device *pdev) |
538 | { | 537 | { |
539 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | 538 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); |
@@ -553,7 +552,6 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | |||
553 | .init = pcm037_usbh2_init, | 552 | .init = pcm037_usbh2_init, |
554 | .portsc = MXC_EHCI_MODE_ULPI, | 553 | .portsc = MXC_EHCI_MODE_ULPI, |
555 | }; | 554 | }; |
556 | #endif | ||
557 | 555 | ||
558 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 556 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
559 | .operating_mode = FSL_USB2_DR_DEVICE, | 557 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -656,19 +654,18 @@ static void __init pcm037_init(void) | |||
656 | 654 | ||
657 | platform_device_register(&pcm970_sja1000); | 655 | platform_device_register(&pcm970_sja1000); |
658 | 656 | ||
659 | #if defined(CONFIG_USB_ULPI) | ||
660 | if (otg_mode_host) { | 657 | if (otg_mode_host) { |
661 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 658 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
662 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 659 | ULPI_OTG_DRVVBUS_EXT); |
663 | 660 | if (otg_pdata.otg) | |
664 | imx31_add_mxc_ehci_otg(&otg_pdata); | 661 | imx31_add_mxc_ehci_otg(&otg_pdata); |
665 | } | 662 | } |
666 | 663 | ||
667 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 664 | usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
668 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 665 | ULPI_OTG_DRVVBUS_EXT); |
666 | if (usbh2_pdata.otg) | ||
667 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
669 | 668 | ||
670 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
671 | #endif | ||
672 | if (!otg_mode_host) | 669 | if (!otg_mode_host) |
673 | imx31_add_fsl_usb2_udc(&otg_device_pdata); | 670 | imx31_add_fsl_usb2_udc(&otg_device_pdata); |
674 | 671 | ||
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 262af17db44c..b3ecfb22d241 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -305,7 +305,6 @@ pcm037_nand_board_info __initconst = { | |||
305 | .hw_ecc = 1, | 305 | .hw_ecc = 1, |
306 | }; | 306 | }; |
307 | 307 | ||
308 | #if defined(CONFIG_USB_ULPI) | ||
309 | static int pcm043_otg_init(struct platform_device *pdev) | 308 | static int pcm043_otg_init(struct platform_device *pdev) |
310 | { | 309 | { |
311 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | 310 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); |
@@ -315,7 +314,6 @@ static struct mxc_usbh_platform_data otg_pdata __initdata = { | |||
315 | .init = pcm043_otg_init, | 314 | .init = pcm043_otg_init, |
316 | .portsc = MXC_EHCI_MODE_UTMI, | 315 | .portsc = MXC_EHCI_MODE_UTMI, |
317 | }; | 316 | }; |
318 | #endif | ||
319 | 317 | ||
320 | static int pcm043_usbh1_init(struct platform_device *pdev) | 318 | static int pcm043_usbh1_init(struct platform_device *pdev) |
321 | { | 319 | { |
@@ -385,14 +383,12 @@ static void __init pcm043_init(void) | |||
385 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 383 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
386 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | 384 | mxc_register_device(&mx3_fb, &mx3fb_pdata); |
387 | 385 | ||
388 | #if defined(CONFIG_USB_ULPI) | ||
389 | if (otg_mode_host) { | 386 | if (otg_mode_host) { |
390 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 387 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
391 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 388 | ULPI_OTG_DRVVBUS_EXT); |
392 | 389 | if (otg_pdata.otg) | |
393 | imx35_add_mxc_ehci_otg(&otg_pdata); | 390 | imx35_add_mxc_ehci_otg(&otg_pdata); |
394 | } | 391 | } |
395 | #endif | ||
396 | imx35_add_mxc_ehci_hs(&usbh1_pdata); | 392 | imx35_add_mxc_ehci_hs(&usbh1_pdata); |
397 | 393 | ||
398 | if (!otg_mode_host) | 394 | if (!otg_mode_host) |
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c index 87d556f40ecf..35f806e737c1 100644 --- a/arch/arm/mach-mx3/mx31moboard-smartbot.c +++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c | |||
@@ -137,8 +137,10 @@ static int __init smartbot_otg_host_init(void) | |||
137 | { | 137 | { |
138 | struct platform_device *pdev; | 138 | struct platform_device *pdev; |
139 | 139 | ||
140 | otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 140 | otg_host_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
141 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 141 | ULPI_OTG_DRVVBUS_EXT); |
142 | if (!otg_host_pdata.otg) | ||
143 | return -ENODEV; | ||
142 | 144 | ||
143 | pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata); | 145 | pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata); |
144 | if (IS_ERR(pdev)) | 146 | if (IS_ERR(pdev)) |
diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c index 18e29b9b088b..db04ce8462dc 100644 --- a/arch/arm/mach-mx5/board-mx51_efikasb.c +++ b/arch/arm/mach-mx5/board-mx51_efikasb.c | |||
@@ -129,10 +129,10 @@ static struct mxc_usbh_platform_data usbh2_config = { | |||
129 | 129 | ||
130 | static void __init mx51_efikasb_usb(void) | 130 | static void __init mx51_efikasb_usb(void) |
131 | { | 131 | { |
132 | usbh2_config.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 132 | usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
133 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT | | 133 | ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND); |
134 | ULPI_OTG_EXTVBUSIND); | 134 | if (usbh2_config.otg) |
135 | mxc_register_device(&mxc_usbh2_device, &usbh2_config); | 135 | mxc_register_device(&mxc_usbh2_device, &usbh2_config); |
136 | } | 136 | } |
137 | 137 | ||
138 | static struct gpio_led mx51_efikasb_leds[] = { | 138 | static struct gpio_led mx51_efikasb_leds[] = { |
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c index 74991c913bf6..51a67fc7f0ef 100644 --- a/arch/arm/mach-mx5/mx51_efika.c +++ b/arch/arm/mach-mx5/mx51_efika.c | |||
@@ -218,12 +218,12 @@ static void __init mx51_efika_usb(void) | |||
218 | msleep(1); | 218 | msleep(1); |
219 | gpio_set_value(EFIKA_USB_PHY_RESET, 1); | 219 | gpio_set_value(EFIKA_USB_PHY_RESET, 1); |
220 | 220 | ||
221 | usbh1_config.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 221 | usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
222 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT | | 222 | ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND); |
223 | ULPI_OTG_EXTVBUSIND); | ||
224 | 223 | ||
225 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); | 224 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); |
226 | mxc_register_device(&mxc_usbh1_device, &usbh1_config); | 225 | if (usbh1_config.otg) |
226 | mxc_register_device(&mxc_usbh1_device, &usbh1_config); | ||
227 | } | 227 | } |
228 | 228 | ||
229 | static struct mtd_partition mx51_efika_spi_nor_partitions[] = { | 229 | static struct mtd_partition mx51_efika_spi_nor_partitions[] = { |
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h index 96b6ab4c40c3..f9161c96d7bd 100644 --- a/arch/arm/plat-mxc/include/mach/ulpi.h +++ b/arch/arm/plat-mxc/include/mach/ulpi.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef __MACH_ULPI_H | 1 | #ifndef __MACH_ULPI_H |
2 | #define __MACH_ULPI_H | 2 | #define __MACH_ULPI_H |
3 | 3 | ||
4 | #ifdef CONFIG_USB_ULPI | ||
5 | struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags); | ||
6 | #else | ||
7 | static inline struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) | ||
8 | { | ||
9 | return NULL; | ||
10 | } | ||
11 | #endif | ||
12 | |||
4 | extern struct otg_io_access_ops mxc_ulpi_access_ops; | 13 | extern struct otg_io_access_ops mxc_ulpi_access_ops; |
5 | 14 | ||
6 | #endif /* __MACH_ULPI_H */ | 15 | #endif /* __MACH_ULPI_H */ |
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c index 582c6dfaba4a..477e45bea1be 100644 --- a/arch/arm/plat-mxc/ulpi.c +++ b/arch/arm/plat-mxc/ulpi.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/usb/otg.h> | 24 | #include <linux/usb/otg.h> |
25 | #include <linux/usb/ulpi.h> | ||
25 | 26 | ||
26 | #include <mach/ulpi.h> | 27 | #include <mach/ulpi.h> |
27 | 28 | ||
@@ -111,3 +112,7 @@ struct otg_io_access_ops mxc_ulpi_access_ops = { | |||
111 | }; | 112 | }; |
112 | EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops); | 113 | EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops); |
113 | 114 | ||
115 | struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) | ||
116 | { | ||
117 | return otg_ulpi_create(&mxc_ulpi_access_ops, flags); | ||
118 | } | ||