Skip to content

Commit

Permalink
Merge branch 'for-next/musb' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/balbi/usb into usb-next

* 'for-next/musb' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb:
  usb: musb: remove extern qualifier from musb_debug.h header
  usb: musb: cleanup kconfig
  usb: musb: trivial Kconfig cleanups
  musb: omap2430: avoid pm_runtime_disable()
  usb: musb: remove a bit of indentation
  usb: musb: trivial cleanup
  usb: musb: fix pm_runtime mismatch
  • Loading branch information
Greg Kroah-Hartman committed Dec 22, 2011
2 parents 06e298b + b0945c0 commit 6db174e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 34 deletions.
12 changes: 5 additions & 7 deletions drivers/usb/musb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
depends on USB && USB_GADGET
select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
select TWL4030_USB if MACH_OMAP_3430SDP
select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
select USB_OTG_UTILS
select USB_GADGET_DUALSPEED
tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
help
Say Y here if your system has a dual role high speed USB
controller based on the Mentor Graphics silicon IP. Then
Expand All @@ -30,9 +30,10 @@ config USB_MUSB_HDRC
To compile this driver as a module, choose M here; the
module will be called "musb-hdrc".

if USB_MUSB_HDRC

choice
prompt "Platform Glue Layer"
depends on USB_MUSB_HDRC

config USB_MUSB_DAVINCI
tristate "DaVinci"
Expand Down Expand Up @@ -77,36 +78,31 @@ choice

config USB_UX500_DMA
bool 'ST Ericsson U8500 and U5500'
depends on USB_MUSB_HDRC
depends on USB_MUSB_UX500
help
Enable DMA transfers on UX500 platforms.

config USB_INVENTRA_DMA
bool 'Inventra'
depends on USB_MUSB_HDRC
depends on USB_MUSB_OMAP2PLUS || USB_MUSB_BLACKFIN
help
Enable DMA transfers using Mentor's engine.

config USB_TI_CPPI_DMA
bool 'TI CPPI (Davinci)'
depends on USB_MUSB_HDRC
depends on USB_MUSB_DAVINCI
help
Enable DMA transfers when TI CPPI DMA is available.

config USB_TUSB_OMAP_DMA
bool 'TUSB 6010'
depends on USB_MUSB_HDRC
depends on USB_MUSB_TUSB6010
depends on ARCH_OMAP
help
Enable DMA transfers on TUSB 6010 when OMAP DMA is available.

config MUSB_PIO_ONLY
bool 'Disable DMA (always use PIO)'
depends on USB_MUSB_HDRC
help
All data is copied between memory and FIFO by the CPU.
DMA controllers are ignored.
Expand All @@ -117,3 +113,5 @@ config MUSB_PIO_ONLY
parameter.

endchoice

endif # USB_MUSB_HDRC
2 changes: 0 additions & 2 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2012,8 +2012,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
if (status < 0)
goto fail3;

pm_runtime_put(musb->controller);

status = musb_init_debugfs(musb);
if (status < 0)
goto fail4;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/musb/musb_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args)

#ifdef CONFIG_DEBUG_FS
extern int musb_init_debugfs(struct musb *musb);
extern void musb_exit_debugfs(struct musb *musb);
int musb_init_debugfs(struct musb *musb);
void musb_exit_debugfs(struct musb *musb);
#else
static inline int musb_init_debugfs(struct musb *musb)
{
Expand Down
37 changes: 14 additions & 23 deletions drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
case USB_EVENT_ID:
dev_dbg(musb->controller, "ID GND\n");

if (is_otg_enabled(musb)) {
if (musb->gadget_driver) {
pm_runtime_get_sync(musb->controller);
otg_init(musb->xceiv);
omap2430_musb_set_vbus(musb, 1);
}
} else {
if (!is_otg_enabled(musb) || musb->gadget_driver) {
pm_runtime_get_sync(musb->controller);
otg_init(musb->xceiv);
omap2430_musb_set_vbus(musb, 1);
Expand Down Expand Up @@ -342,7 +336,6 @@ static int omap2430_musb_init(struct musb *musb)
return 0;

err1:
pm_runtime_disable(dev);
return status;
}

Expand All @@ -358,20 +351,19 @@ static void omap2430_musb_enable(struct musb *musb)

case USB_EVENT_ID:
otg_init(musb->xceiv);
if (data->interface_type == MUSB_INTERFACE_UTMI) {
devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
/* start the session */
devctl |= MUSB_DEVCTL_SESSION;
musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
while (musb_readb(musb->mregs, MUSB_DEVCTL) &
MUSB_DEVCTL_BDEVICE) {
cpu_relax();

if (time_after(jiffies, timeout)) {
dev_err(musb->controller,
"configured as A device timeout");
break;
}
if (data->interface_type != MUSB_INTERFACE_UTMI)
break;
devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
/* start the session */
devctl |= MUSB_DEVCTL_SESSION;
musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
while (musb_readb(musb->mregs, MUSB_DEVCTL) &
MUSB_DEVCTL_BDEVICE) {
cpu_relax();

if (time_after(jiffies, timeout)) {
dev_err(dev, "configured as A device timeout");
break;
}
}
break;
Expand Down Expand Up @@ -486,7 +478,6 @@ static int __exit omap2430_remove(struct platform_device *pdev)
platform_device_del(glue->musb);
platform_device_put(glue->musb);
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
kfree(glue);

return 0;
Expand Down

0 comments on commit 6db174e

Please sign in to comment.