diff options
author | Felipe Balbi <balbi@ti.com> | 2010-12-01 06:22:05 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2010-12-07 02:19:39 -0500 |
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) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * musb_platform_enable - enable interrupts | 125 | * am35x_musb_enable - enable interrupts |
126 | */ | 126 | */ |
127 | void musb_platform_enable(struct musb *musb) | 127 | static void am35x_musb_enable(struct musb *musb) |
128 | { | 128 | { |
129 | void __iomem *reg_base = musb->ctrl_base; | 129 | void __iomem *reg_base = musb->ctrl_base; |
130 | u32 epmask; | 130 | u32 epmask; |
@@ -143,9 +143,9 @@ void musb_platform_enable(struct musb *musb) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | /* | 145 | /* |
146 | * musb_platform_disable - disable HDRC and flush interrupts | 146 | * am35x_musb_disable - disable HDRC and flush interrupts |
147 | */ | 147 | */ |
148 | void musb_platform_disable(struct musb *musb) | 148 | static void am35x_musb_disable(struct musb *musb) |
149 | { | 149 | { |
150 | void __iomem *reg_base = musb->ctrl_base; | 150 | void __iomem *reg_base = musb->ctrl_base; |
151 | 151 | ||
@@ -162,7 +162,7 @@ void musb_platform_disable(struct musb *musb) | |||
162 | #define portstate(stmt) | 162 | #define portstate(stmt) |
163 | #endif | 163 | #endif |
164 | 164 | ||
165 | static void am35x_set_vbus(struct musb *musb, int is_on) | 165 | static void am35x_musb_set_vbus(struct musb *musb, int is_on) |
166 | { | 166 | { |
167 | WARN_ON(is_on && is_peripheral_active(musb)); | 167 | WARN_ON(is_on && is_peripheral_active(musb)); |
168 | } | 168 | } |
@@ -221,7 +221,7 @@ static void otg_timer(unsigned long _musb) | |||
221 | spin_unlock_irqrestore(&musb->lock, flags); | 221 | spin_unlock_irqrestore(&musb->lock, flags); |
222 | } | 222 | } |
223 | 223 | ||
224 | void musb_platform_try_idle(struct musb *musb, unsigned long timeout) | 224 | static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout) |
225 | { | 225 | { |
226 | static unsigned long last_timer; | 226 | static unsigned long last_timer; |
227 | 227 | ||
@@ -251,7 +251,7 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout) | |||
251 | mod_timer(&otg_workaround, timeout); | 251 | mod_timer(&otg_workaround, timeout); |
252 | } | 252 | } |
253 | 253 | ||
254 | static irqreturn_t am35x_interrupt(int irq, void *hci) | 254 | static irqreturn_t am35x_musb_interrupt(int irq, void *hci) |
255 | { | 255 | { |
256 | struct musb *musb = hci; | 256 | struct musb *musb = hci; |
257 | void __iomem *reg_base = musb->ctrl_base; | 257 | void __iomem *reg_base = musb->ctrl_base; |
@@ -362,7 +362,7 @@ eoi: | |||
362 | return ret; | 362 | return ret; |
363 | } | 363 | } |
364 | 364 | ||
365 | int musb_platform_set_mode(struct musb *musb, u8 musb_mode) | 365 | static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode) |
366 | { | 366 | { |
367 | u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | 367 | u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); |
368 | 368 | ||
@@ -391,7 +391,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
391 | return 0; | 391 | return 0; |
392 | } | 392 | } |
393 | 393 | ||
394 | int __init musb_platform_init(struct musb *musb, void *board_data) | 394 | static int am35x_musb_init(struct musb *musb) |
395 | { | 395 | { |
396 | void __iomem *reg_base = musb->ctrl_base; | 396 | void __iomem *reg_base = musb->ctrl_base; |
397 | u32 rev, lvl_intr, sw_reset; | 397 | u32 rev, lvl_intr, sw_reset; |
@@ -427,7 +427,7 @@ int __init musb_platform_init(struct musb *musb, void *board_data) | |||
427 | if (is_host_enabled(musb)) | 427 | if (is_host_enabled(musb)) |
428 | setup_timer(&otg_workaround, otg_timer, (unsigned long) musb); | 428 | setup_timer(&otg_workaround, otg_timer, (unsigned long) musb); |
429 | 429 | ||
430 | musb->board_set_vbus = am35x_set_vbus; | 430 | musb->board_set_vbus = am35x_musb_set_vbus; |
431 | 431 | ||
432 | /* Global reset */ | 432 | /* Global reset */ |
433 | sw_reset = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); | 433 | 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) | |||
446 | 446 | ||
447 | msleep(5); | 447 | msleep(5); |
448 | 448 | ||
449 | musb->isr = am35x_interrupt; | 449 | musb->isr = am35x_musb_interrupt; |
450 | 450 | ||
451 | /* clear level interrupt */ | 451 | /* clear level interrupt */ |
452 | lvl_intr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); | 452 | lvl_intr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); |
@@ -461,7 +461,7 @@ exit0: | |||
461 | return status; | 461 | return status; |
462 | } | 462 | } |
463 | 463 | ||
464 | int musb_platform_exit(struct musb *musb) | 464 | static int am35x_musb_exit(struct musb *musb) |
465 | { | 465 | { |
466 | if (is_host_enabled(musb)) | 466 | if (is_host_enabled(musb)) |
467 | del_timer_sync(&otg_workaround); | 467 | del_timer_sync(&otg_workaround); |
@@ -522,3 +522,16 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) | |||
522 | memcpy(dst, &val, len); | 522 | memcpy(dst, &val, len); |
523 | } | 523 | } |
524 | } | 524 | } |
525 | |||
526 | const struct musb_platform_ops musb_ops = { | ||
527 | .init = am35x_musb_init, | ||
528 | .exit = am35x_musb_exit, | ||
529 | |||
530 | .enable = am35x_musb_enable, | ||
531 | .disable = am35x_musb_disable, | ||
532 | |||
533 | .set_mode = am35x_musb_set_mode, | ||
534 | .try_idle = am35x_musb_try_idle, | ||
535 | |||
536 | .set_vbus = am35x_musb_set_vbus, | ||
537 | }; | ||