From 743411b3f3e96e8ac4cae73551a0a95392fed1ea Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Wed, 1 Dec 2010 13:22:05 +0200 Subject: usb: musb: make all glue layer export struct musb_platform_ops preparing to a big refactor on musb code. We need to be able to compile in all glue layers (or at least all ARM-based ones) together and have a working binary. While preparing for that, we move every glue layer to export only one symbol, which is a struct musb_platform_ops, and make all other functions static. Later patches will come to allow for compiling all glue layers together and have a working binary. Signed-off-by: Felipe Balbi --- drivers/usb/musb/omap2430.c | 46 ++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 27dabcf..5f0d0f1 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -35,7 +35,6 @@ #include "musb_core.h" #include "omap2430.h" - static struct timer_list musb_idle_timer; static void musb_do_idle(unsigned long _musb) @@ -98,7 +97,7 @@ static void musb_do_idle(unsigned long _musb) } -void musb_platform_try_idle(struct musb *musb, unsigned long timeout) +static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout) { unsigned long default_timeout = jiffies + msecs_to_jiffies(3); static unsigned long last_timer; @@ -131,13 +130,15 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout) mod_timer(&musb_idle_timer, timeout); } -void musb_platform_enable(struct musb *musb) +static void omap2430_musb_enable(struct musb *musb) { } -void musb_platform_disable(struct musb *musb) + +static void omap2430_musb_disable(struct musb *musb) { } -static void omap_set_vbus(struct musb *musb, int is_on) + +static void omap2430_musb_set_vbus(struct musb *musb, int is_on) { u8 devctl; /* HDRC controls CPEN, but beware current surges during device @@ -175,9 +176,9 @@ static void omap_set_vbus(struct musb *musb, int is_on) musb_readb(musb->mregs, MUSB_DEVCTL)); } -static int musb_platform_resume(struct musb *musb); +static int omap2430_musb_resume(struct musb *musb); -int musb_platform_set_mode(struct musb *musb, u8 musb_mode) +static int omap2430_musb_set_mode(struct musb *musb, u8 musb_mode) { u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); @@ -187,7 +188,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) return 0; } -int __init musb_platform_init(struct musb *musb) +static int omap2430_musb_init(struct musb *musb) { u32 l; struct device *dev = musb->controller; @@ -204,7 +205,7 @@ int __init musb_platform_init(struct musb *musb) return -ENODEV; } - musb_platform_resume(musb); + omap2430_musb_resume(musb); l = musb_readl(musb->mregs, OTG_SYSCONFIG); l &= ~ENABLEWAKEUP; /* disable wakeup */ @@ -242,7 +243,7 @@ int __init musb_platform_init(struct musb *musb) musb_readl(musb->mregs, OTG_SIMENABLE)); if (is_host_enabled(musb)) - musb->board_set_vbus = omap_set_vbus; + musb->board_set_vbus = omap2430_musb_set_vbus; setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); @@ -265,7 +266,7 @@ void musb_platform_restore_context(struct musb *musb, } #endif -static int musb_platform_suspend(struct musb *musb) +static int omap2430_musb_suspend(struct musb *musb) { u32 l; @@ -291,7 +292,7 @@ static int musb_platform_suspend(struct musb *musb) return 0; } -static int musb_platform_resume(struct musb *musb) +static int omap2430_musb_resume(struct musb *musb) { u32 l; @@ -316,12 +317,27 @@ static int musb_platform_resume(struct musb *musb) return 0; } - -int musb_platform_exit(struct musb *musb) +static int omap2430_musb_exit(struct musb *musb) { - musb_platform_suspend(musb); + omap2430_musb_suspend(musb); otg_put_transceiver(musb->xceiv); return 0; } + +const struct musb_platform_ops musb_ops = { + .init = omap2430_musb_init, + .exit = omap2430_musb_exit, + + .suspend = omap2430_musb_suspend, + .resume = omap2430_musb_resume, + + .enable = omap2430_musb_enable, + .disable = omap2430_musb_disable, + + .set_mode = omap2430_musb_set_mode, + .try_idle = omap2430_musb_try_idle, + + .set_vbus = omap2430_musb_set_vbus, +}; -- cgit v1.1