summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-10 12:17:06 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-18 14:42:35 +0200
commit9451a44433577363f9b0a91bd656aecb51c76e8f (patch)
tree6397cfa2cb7ab0d2a336fe8f046ca1876f87a173 /drivers/usb/host/ehci-hcd.c
parentf0a1a84d7d50c7f74e2403625eb91cd56464fe33 (diff)
downloadbarebox-9451a44433577363f9b0a91bd656aecb51c76e8f.tar.gz
barebox-9451a44433577363f9b0a91bd656aecb51c76e8f.tar.xz
USB: Remove conflicting USB_SPEED_* definitions
We have USB_SPEED_* definitions as macros in usb_defs.h and as an enum in ch9.h. The defines in usb.h correspond to hardware bits in the ehci controller. Get rid of them and keep the hardware independent enums. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2da3edd296..d30c3aa1d1 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -229,16 +229,29 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
qh = &ehci->qh_list[1];
qh->qh_link = cpu_to_hc32((uint32_t)ehci->qh_list | QH_LINK_TYPE_QH);
- c = (usb_pipespeed(pipe) != USB_SPEED_HIGH &&
+ c = (dev->speed != USB_SPEED_HIGH &&
usb_pipeendpoint(pipe) == 0) ? 1 : 0;
endpt = (8 << 28) |
(c << 27) |
(usb_maxpacket(dev, pipe) << 16) |
(0 << 15) |
(1 << 14) |
- (usb_pipespeed(pipe) << 12) |
(usb_pipeendpoint(pipe) << 8) |
(0 << 7) | (usb_pipedevice(pipe) << 0);
+ switch (dev->speed) {
+ case USB_SPEED_FULL:
+ endpt |= 0 << 12;
+ break;
+ case USB_SPEED_LOW:
+ endpt |= 1 << 12;
+ break;
+ case USB_SPEED_HIGH:
+ endpt |= 2 << 12;
+ break;
+ default:
+ return -EINVAL;
+ }
+
qh->qh_endpt1 = cpu_to_hc32(endpt);
endpt = (1 << 30) |
(dev->portnr << 23) |