Commit 1eec34e9 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi

usb: musb: musb_cppi41: recognize HS devices in hostmode

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: 50aea6fc ("usb: musb: cppi41: fire hrtimer according to
programmed channel length")
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c2365ce5
...@@ -253,6 +253,7 @@ static void cppi41_dma_callback(void *private_data) ...@@ -253,6 +253,7 @@ static void cppi41_dma_callback(void *private_data)
cppi41_trans_done(cppi41_channel); cppi41_trans_done(cppi41_channel);
} else { } else {
struct cppi41_dma_controller *controller; struct cppi41_dma_controller *controller;
int is_hs = 0;
/* /*
* On AM335x it has been observed that the TX interrupt fires * On AM335x it has been observed that the TX interrupt fires
* too early that means the TXFIFO is not yet empty but the DMA * too early that means the TXFIFO is not yet empty but the DMA
...@@ -265,7 +266,14 @@ static void cppi41_dma_callback(void *private_data) ...@@ -265,7 +266,14 @@ static void cppi41_dma_callback(void *private_data)
*/ */
controller = cppi41_channel->controller; 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; unsigned wait = 25;
do { do {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment