aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/omap2430.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2010-12-01 06:22:05 -0500
committerFelipe Balbi <balbi@ti.com>2010-12-07 02:19:39 -0500
commit743411b3f3e96e8ac4cae73551a0a95392fed1ea (patch)
tree485f2f1f92768df7b1cc2d44cf3b8d4cc3cdaf3b /drivers/usb/musb/omap2430.c
parent3ca8abb84522f4b773678726db6ebd6fc277bc96 (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/omap2430.c')
-rw-r--r--drivers/usb/musb/omap2430.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 27dabcf0a868..5f0d0f105989 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -35,7 +35,6 @@
35#include "musb_core.h" 35#include "musb_core.h"
36#include "omap2430.h" 36#include "omap2430.h"
37 37
38
39static struct timer_list musb_idle_timer; 38static struct timer_list musb_idle_timer;
40 39
41static void musb_do_idle(unsigned long _musb) 40static void musb_do_idle(unsigned long _musb)
@@ -98,7 +97,7 @@ static void musb_do_idle(unsigned long _musb)
98} 97}
99 98
100 99
101void musb_platform_try_idle(struct musb *musb, unsigned long timeout) 100static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
102{ 101{
103 unsigned long default_timeout = jiffies + msecs_to_jiffies(3); 102 unsigned long default_timeout = jiffies + msecs_to_jiffies(3);
104 static unsigned long last_timer; 103 static unsigned long last_timer;
@@ -131,13 +130,15 @@ void musb_platform_try_idle(struct musb *musb, unsigned long timeout)
131 mod_timer(&musb_idle_timer, timeout); 130 mod_timer(&musb_idle_timer, timeout);
132} 131}
133 132
134void musb_platform_enable(struct musb *musb) 133static void omap2430_musb_enable(struct musb *musb)
135{ 134{
136} 135}
137void musb_platform_disable(struct musb *musb) 136
137static void omap2430_musb_disable(struct musb *musb)
138{ 138{
139} 139}
140static void omap_set_vbus(struct musb *musb, int is_on) 140
141static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
141{ 142{
142 u8 devctl; 143 u8 devctl;
143 /* HDRC controls CPEN, but beware current surges during device 144 /* HDRC controls CPEN, but beware current surges during device
@@ -175,9 +176,9 @@ static void omap_set_vbus(struct musb *musb, int is_on)
175 musb_readb(musb->mregs, MUSB_DEVCTL)); 176 musb_readb(musb->mregs, MUSB_DEVCTL));
176} 177}
177 178
178static int musb_platform_resume(struct musb *musb); 179static int omap2430_musb_resume(struct musb *musb);
179 180
180int musb_platform_set_mode(struct musb *musb, u8 musb_mode) 181static int omap2430_musb_set_mode(struct musb *musb, u8 musb_mode)
181{ 182{
182 u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 183 u8 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
183 184
@@ -187,7 +188,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
187 return 0; 188 return 0;
188} 189}
189 190
190int __init musb_platform_init(struct musb *musb) 191static int omap2430_musb_init(struct musb *musb)
191{ 192{
192 u32 l; 193 u32 l;
193 struct device *dev = musb->controller; 194 struct device *dev = musb->controller;
@@ -204,7 +205,7 @@ int __init musb_platform_init(struct musb *musb)
204 return -ENODEV; 205 return -ENODEV;
205 } 206 }
206 207
207 musb_platform_resume(musb); 208 omap2430_musb_resume(musb);
208 209
209 l = musb_readl(musb->mregs, OTG_SYSCONFIG); 210 l = musb_readl(musb->mregs, OTG_SYSCONFIG);
210 l &= ~ENABLEWAKEUP; /* disable wakeup */ 211 l &= ~ENABLEWAKEUP; /* disable wakeup */
@@ -242,7 +243,7 @@ int __init musb_platform_init(struct musb *musb)
242 musb_readl(musb->mregs, OTG_SIMENABLE)); 243 musb_readl(musb->mregs, OTG_SIMENABLE));
243 244
244 if (is_host_enabled(musb)) 245 if (is_host_enabled(musb))
245 musb->board_set_vbus = omap_set_vbus; 246 musb->board_set_vbus = omap2430_musb_set_vbus;
246 247
247 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); 248 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
248 249
@@ -265,7 +266,7 @@ void musb_platform_restore_context(struct musb *musb,
265} 266}
266#endif 267#endif
267 268
268static int musb_platform_suspend(struct musb *musb) 269static int omap2430_musb_suspend(struct musb *musb)
269{ 270{
270 u32 l; 271 u32 l;
271 272
@@ -291,7 +292,7 @@ static int musb_platform_suspend(struct musb *musb)
291 return 0; 292 return 0;
292} 293}
293 294
294static int musb_platform_resume(struct musb *musb) 295static int omap2430_musb_resume(struct musb *musb)
295{ 296{
296 u32 l; 297 u32 l;
297 298
@@ -316,12 +317,27 @@ static int musb_platform_resume(struct musb *musb)
316 return 0; 317 return 0;
317} 318}
318 319
319 320static int omap2430_musb_exit(struct musb *musb)
320int musb_platform_exit(struct musb *musb)
321{ 321{
322 322
323 musb_platform_suspend(musb); 323 omap2430_musb_suspend(musb);
324 324
325 otg_put_transceiver(musb->xceiv); 325 otg_put_transceiver(musb->xceiv);
326 return 0; 326 return 0;
327} 327}
328
329const struct musb_platform_ops musb_ops = {
330 .init = omap2430_musb_init,
331 .exit = omap2430_musb_exit,
332
333 .suspend = omap2430_musb_suspend,
334 .resume = omap2430_musb_resume,
335
336 .enable = omap2430_musb_enable,
337 .disable = omap2430_musb_disable,
338
339 .set_mode = omap2430_musb_set_mode,
340 .try_idle = omap2430_musb_try_idle,
341
342 .set_vbus = omap2430_musb_set_vbus,
343};