summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2014-11-13 18:28:47 +0100
committerJiri Slaby <jslaby@suse.cz>2016-11-28 22:22:49 +0100
commit1af405b19798ba98c7c1971202a1c8972e303f66 (patch)
tree36c76c5166a7ebd3ea16be7437db43894072eb44
parenta8767147535ae95719119a469cfe786b1cfd1deb (diff)
downloadlinux-stable-1af405b19798ba98c7c1971202a1c8972e303f66.tar.gz
linux-stable-1af405b19798ba98c7c1971202a1c8972e303f66.tar.bz2
linux-stable-1af405b19798ba98c7c1971202a1c8972e303f66.zip
usb: musb: musb_cppi41: recognize HS devices in hostmode
commit 1eec34e9f25664cf71e05321329d128e0565beae upstream. There is a poll loop for max 25us for HS devices. Now guess what, I tested it in gadget mode and forgot about the little detail. Nobody seem to have it noticed… This patch adds the missing logic for hostmode so it is recognized in host and device mode properly. Fixes: 50aea6fca771 ("usb: musb: cppi41: fire hrtimer according to programmed channel length") Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--drivers/usb/musb/musb_cppi41.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index cce32e91fd9e..83bee312df8d 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -234,6 +234,7 @@ static void cppi41_dma_callback(void *private_data)
cppi41_trans_done(cppi41_channel);
} else {
struct cppi41_dma_controller *controller;
+ int is_hs = 0;
/*
* On AM335x it has been observed that the TX interrupt fires
* too early that means the TXFIFO is not yet empty but the DMA
@@ -246,7 +247,14 @@ static void cppi41_dma_callback(void *private_data)
*/
controller = cppi41_channel->controller;
- if (musb->g.speed == USB_SPEED_HIGH) {
+ if (is_host_active(musb)) {
+ if (musb->port1_status & USB_PORT_STAT_HIGH_SPEED)
+ is_hs = 1;
+ } else {
+ if (musb->g.speed == USB_SPEED_HIGH)
+ is_hs = 1;
+ }
+ if (is_hs) {
unsigned wait = 25;
do {