]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: start musb on the udc side, too
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 11 Oct 2013 08:38:13 +0000 (10:38 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 11 Oct 2013 15:39:35 +0000 (10:39 -0500)
commit6764330bdd2df710c5d206bbfebd96e5bb56ab3c
tree8343ad761d519da0919817295ab2dc8a29694da2
parent023e2133dc09f942fafa51b67ab64b7dafb2a075
usb: musb: start musb on the udc side, too

I have am335x-evm with one port running in OTG mode. Since commit
4bcada5 ("usb: musb: gadget: remove hcd initialization") the loaded
gadget does non pop up on the host. All I see is
|usb 4-5: new high-speed USB device number 52 using ehci-pci
|usb 4-5: device descriptor read/64, error -110

Since a later commit 3ac842b ("usb: musb: add musb_host_setup() and
musb_host_cleanup()) the gadget shows up on the host again but only
in OTG mode (because we have the host init code running). It does not
work in device only mode.
If running in OTG mode and the gadget is removed and added back (rmmod
followed by modprobe of a gadget) then the same error is pops up on the
host side.

This patch ensures that the gadget side also executes musb_start() which
puts the chip in "connect accept" mode. With this change the device
works in OTG & device mode and the gadget can be added & removed
multiple times.
A device (if musb is in OTG mode acting as a host) is only recognized if
it is attached during module load (musb_hdrc module). After the device
unplugged and plugged again the host does not recognize it. We get a
buch of errors if musb running in OTG mode, attached to a host and no
gadget is loaded. Bah.
This is one step forward. Host & device only mode should work. I will
look at OTG later. I looked at this before commit 4bcada5 and OTG wasn't
working there perfectly so I am not sure that it is a regression :)

Cc: <stable@vger.kernel.org> # v3.11
Cc: Daniel Mack <zonque@gmail.com>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_gadget.c
drivers/usb/musb/musb_virthub.c