summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Voytik <voytikd@gmail.com>2014-10-16 16:52:20 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-21 12:57:25 +0200
commitd8f5a28be3e6a671bc257b479cf54953d8d4a3c6 (patch)
tree48c6c8361be4b8cbbc35201498274a6c6f92967d
parent11632790dae23afa0557b1b70eac65931950b674 (diff)
downloadbarebox-d8f5a28be3e6a671bc257b479cf54953d8d4a3c6.tar.gz
barebox-d8f5a28be3e6a671bc257b479cf54953d8d4a3c6.tar.xz
usb: ehci-hcd: Correct CLEAR_FEATURE code
This commit broke USB on olinuxino board: 87b9bea USB: host: hub: Use usb_hub_power_on from U-Boot This patch was ported from U-Boot with small changes. See discussion: http://lists.denx.de/pipermail/u-boot/2013-May/153920.html The root cause seems to be a missing mask and missing 'break' in ehci-hcd.c. Fix both. Signed-off-by: Dmitry Voytik <voytikd@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/host/ehci-hcd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5624552c0..d2e129679 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -675,21 +675,23 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
break;
case USB_REQ_CLEAR_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8):
reg = ehci_readl(status_reg);
+ reg &= ~EHCI_PS_CLEAR;
switch (le16_to_cpu(req->value)) {
case USB_PORT_FEAT_ENABLE:
reg &= ~EHCI_PS_PE;
break;
case USB_PORT_FEAT_C_ENABLE:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_PE;
+ reg |= EHCI_PS_PEC;
break;
case USB_PORT_FEAT_POWER:
if (HCS_PPC(ehci_readl(&ehci->hccr->cr_hcsparams)))
- reg = reg & ~(EHCI_PS_CLEAR | EHCI_PS_PP);
+ reg &= ~ EHCI_PS_PP;
+ break;
case USB_PORT_FEAT_C_CONNECTION:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_CSC;
+ reg |= EHCI_PS_CSC;
break;
case USB_PORT_FEAT_OVER_CURRENT:
- reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_OCC;
+ reg |= EHCI_PS_OCC;
break;
case USB_PORT_FEAT_C_RESET:
ehci->portreset &= ~(1 << le16_to_cpu(req->index));