diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-03-02 03:27:42 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-03-07 13:29:41 -0500 |
commit | 48f6b0999673cce33e4a54d89c78460cc28e5156 (patch) | |
tree | 1ada2b337a7af540246968a9150b0c0a8ebabc3c /arch/arm/mach-mx3/mach-pcm037.c | |
parent | 94573e6623cf9159f036adc670a3d4b29e6d86fe (diff) |
ARM i.MX: introduce imx_otg_ulpi_create to create ULPI transceivers
The boards are currently using otg_ulpi_create and mxc_ulpi_access_ops,
both are only present if CONFIG_USB_ULPI is set. To remove the need of
ifdefs in the board code introduce a imx_otg_ulpi_create functions
which expands to a static inline function if compiled without ulpi.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mach-pcm037.c')
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm037.c | 19 |
1 files changed, 8 insertions, 11 deletions
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 | ||