diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-02-20 16:45:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-27 17:40:51 -0500 |
commit | 34f32c9701013ac5af89b82a6ae285e790b643e7 (patch) | |
tree | 3db26e8ab2990d9e9a14afcef59d810ac88e82ed /drivers | |
parent | 67f5a4ba9741fcef3f4db3509ad03565d9e33af2 (diff) |
usb: musb: make Davinci *work* in mainline
Now that the musb build fixes for DaVinci got merged (RC3?), kick in
the other bits needed to get it finally *working* in mainline:
- Use clk_enable()/clk_disable() ... the "always enable USB clocks"
code this originally relied on has since been removed.
- Initialize the USB device only after the relevant I2C GPIOs are
available, so the host side can properly enable VBUS.
- Tweak init sequencing to cope with mainline's relatively late init
of the I2C system bus for power switches, transceivers, and so on.
Sanity tested on DM6664 EVM for host and peripheral modes; that system
won't boot with CONFIG_PM enabled, so OTG can't yet be tested. Also
verified on OMAP3.
(Unrelated: correct the MODULE_PARM_DESC spelling of musb_debug.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <me@felipebalbi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/musb/davinci.c | 15 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 8 |
2 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 5a8fd5d57a11..2dc7606f319c 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -377,18 +377,8 @@ int __init musb_platform_init(struct musb *musb) | |||
377 | u32 revision; | 377 | u32 revision; |
378 | 378 | ||
379 | musb->mregs += DAVINCI_BASE_OFFSET; | 379 | musb->mregs += DAVINCI_BASE_OFFSET; |
380 | #if 0 | ||
381 | /* REVISIT there's something odd about clocking, this | ||
382 | * didn't appear do the job ... | ||
383 | */ | ||
384 | musb->clock = clk_get(pDevice, "usb"); | ||
385 | if (IS_ERR(musb->clock)) | ||
386 | return PTR_ERR(musb->clock); | ||
387 | 380 | ||
388 | status = clk_enable(musb->clock); | 381 | clk_enable(musb->clock); |
389 | if (status < 0) | ||
390 | return -ENODEV; | ||
391 | #endif | ||
392 | 382 | ||
393 | /* returns zero if e.g. not clocked */ | 383 | /* returns zero if e.g. not clocked */ |
394 | revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); | 384 | revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); |
@@ -453,5 +443,8 @@ int musb_platform_exit(struct musb *musb) | |||
453 | } | 443 | } |
454 | 444 | ||
455 | phy_off(); | 445 | phy_off(); |
446 | |||
447 | clk_disable(musb->clock); | ||
448 | |||
456 | return 0; | 449 | return 0; |
457 | } | 450 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 2cc34fa05b73..b120fdcd8894 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -115,7 +115,7 @@ | |||
115 | 115 | ||
116 | 116 | ||
117 | unsigned musb_debug; | 117 | unsigned musb_debug; |
118 | module_param(musb_debug, uint, S_IRUGO | S_IWUSR); | 118 | module_param_named(debug, musb_debug, uint, S_IRUGO | S_IWUSR); |
119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); | 119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); |
120 | 120 | ||
121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" | 121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" |
@@ -2243,10 +2243,10 @@ static int __init musb_init(void) | |||
2243 | return platform_driver_probe(&musb_driver, musb_probe); | 2243 | return platform_driver_probe(&musb_driver, musb_probe); |
2244 | } | 2244 | } |
2245 | 2245 | ||
2246 | /* make us init after usbcore and before usb | 2246 | /* make us init after usbcore and i2c (transceivers, regulators, etc) |
2247 | * gadget and host-side drivers start to register | 2247 | * and before usb gadget and host-side drivers start to register |
2248 | */ | 2248 | */ |
2249 | subsys_initcall(musb_init); | 2249 | fs_initcall(musb_init); |
2250 | 2250 | ||
2251 | static void __exit musb_cleanup(void) | 2251 | static void __exit musb_cleanup(void) |
2252 | { | 2252 | { |