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/plat-mxc/include/mach/ulpi.h | 9 +++++++++ arch/arm/plat-mxc/ulpi.c | 5 +++++ 2 files changed, 14 insertions(+) (limited to 'arch/arm/plat-mxc') diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h index 96b6ab4..f9161c9 100644 --- a/arch/arm/plat-mxc/include/mach/ulpi.h +++ b/arch/arm/plat-mxc/include/mach/ulpi.h @@ -1,6 +1,15 @@ #ifndef __MACH_ULPI_H #define __MACH_ULPI_H +#ifdef CONFIG_USB_ULPI +struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags); +#else +static inline struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) +{ + return NULL; +} +#endif + extern struct otg_io_access_ops mxc_ulpi_access_ops; #endif /* __MACH_ULPI_H */ diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c index 582c6df..477e45b 100644 --- a/arch/arm/plat-mxc/ulpi.c +++ b/arch/arm/plat-mxc/ulpi.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -111,3 +112,7 @@ struct otg_io_access_ops mxc_ulpi_access_ops = { }; EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops); +struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) +{ + return otg_ulpi_create(&mxc_ulpi_access_ops, flags); +} -- cgit v1.1