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/plat-mxc | |
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/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/include/mach/ulpi.h | 9 | ||||
-rw-r--r-- | arch/arm/plat-mxc/ulpi.c | 5 |
2 files changed, 14 insertions, 0 deletions
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 | } | ||