diff options
author | Felipe Balbi <balbi@ti.com> | 2010-12-01 13:22:05 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2010-12-07 09:19:39 +0200 |
commit | 743411b3f3e96e8ac4cae73551a0a95392fed1ea (patch) | |
tree | 485f2f1f92768df7b1cc2d44cf3b8d4cc3cdaf3b /drivers/usb/musb/am35x.c | |
parent | 3ca8abb84522f4b773678726db6ebd6fc277bc96 (diff) |
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 <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/am35x.c')
-rw-r--r-- | drivers/usb/musb/am35x.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index b0aabf3a606f..be17610d7fc2 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -122,9 +122,9 @@ static inline void phy_off(void) } /* - * musb_platform_enable - enable interrupts + * am35x_musb_enable - enable interrupts */ -void musb_platform_enable(struct musb *musb) +static void am35x_musb_enable(struct musb *musb) { void __iomem *reg_base = musb->ctrl_base; u32 epmask; @@ -143,9 +143,9 @@ void musb_platform_enable(struct musb *musb) } /* - * musb_platform_disable - disable HDRC and flush interrupts + * am35x_musb_disable - disable HDRC and flush interrupts */ -void musb_platform_disable(struct musb *musb) +static void am35x_musb_disable(struct musb *musb) { void __iomem *reg_base = musb->ctrl_base; @@ -162,7 +162,7 @@ void musb_platform_disable(struct musb *musb) #define portstate(stmt) #endif -static void am35x_set_vbus(struct musb *musb, int is_on) +static void am35x_musb_set_vbus(struct musb *musb, int is_on) { WARN_ON(is_on && is_peripheral_active(musb)); } @@ -221,7 +221,7 @@ static void otg_timer(unsigned long _musb) spin_unlock_irqrestore(&musb->lock, flags); } -void musb_platform_try_idle(struct musb *musb, unsigned long timeout) +static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout) { static unsigned long last_timer; @@ -251,7 +251,7 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout) mod_timer(&otg_workaround, timeout); } -static irqreturn_t am35x_interrupt(int irq, void *hci) +static irqreturn_t am35x_musb_interrupt(int irq, void *hci) { struct musb *musb = hci; void __iomem *reg_base = musb->ctrl_base; @@ -362,7 +362,7 @@ eoi: return ret; } -int musb_platform_set_mode(struct musb *musb, u8 musb_mode) +static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode) { u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); @@ -391,7 +391,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) return 0; } -int __init musb_platform_init(struct musb *musb, void *board_data) +static int am35x_musb_init(struct musb *musb) { void __iomem *reg_base = musb->ctrl_base; u32 rev, lvl_intr, sw_reset; @@ -427,7 +427,7 @@ int __init musb_platform_init(struct musb *musb, void *board_data) if (is_host_enabled(musb)) setup_timer(&otg_workaround, otg_timer, (unsigned long) musb); - musb->board_set_vbus = am35x_set_vbus; + musb->board_set_vbus = am35x_musb_set_vbus; /* Global reset */ sw_reset = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); @@ -446,7 +446,7 @@ int __init musb_platform_init(struct musb *musb, void *board_data) msleep(5); - musb->isr = am35x_interrupt; + musb->isr = am35x_musb_interrupt; /* clear level interrupt */ lvl_intr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); @@ -461,7 +461,7 @@ exit0: return status; } -int musb_platform_exit(struct musb *musb) +static int am35x_musb_exit(struct musb *musb) { if (is_host_enabled(musb)) del_timer_sync(&otg_workaround); @@ -522,3 +522,16 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) memcpy(dst, &val, len); } } + +const struct musb_platform_ops musb_ops = { + .init = am35x_musb_init, + .exit = am35x_musb_exit, + + .enable = am35x_musb_enable, + .disable = am35x_musb_disable, + + .set_mode = am35x_musb_set_mode, + .try_idle = am35x_musb_try_idle, + + .set_vbus = am35x_musb_set_vbus, +}; |