From 48f6b0999673cce33e4a54d89c78460cc28e5156 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 2 Mar 2011 09:27:42 +0100 Subject: 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 --- arch/arm/mach-mx3/mach-pcm043.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-mx3/mach-pcm043.c') 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 = { .hw_ecc = 1, }; -#if defined(CONFIG_USB_ULPI) static int pcm043_otg_init(struct platform_device *pdev) { 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 = { .init = pcm043_otg_init, .portsc = MXC_EHCI_MODE_UTMI, }; -#endif static int pcm043_usbh1_init(struct platform_device *pdev) { @@ -385,14 +383,12 @@ static void __init pcm043_init(void) mxc_register_device(&mx3_ipu, &mx3_ipu_data); mxc_register_device(&mx3_fb, &mx3fb_pdata); -#if defined(CONFIG_USB_ULPI) if (otg_mode_host) { - otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, - ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); - - imx35_add_mxc_ehci_otg(&otg_pdata); + otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | + ULPI_OTG_DRVVBUS_EXT); + if (otg_pdata.otg) + imx35_add_mxc_ehci_otg(&otg_pdata); } -#endif imx35_add_mxc_ehci_hs(&usbh1_pdata); if (!otg_mode_host) -- cgit v1.2.1