From 40833fcd9a9689da7c2e8861656e33671f361328 Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Wed, 9 Dec 2009 15:59:11 -0800 Subject: [PATCH] --- yaml --- r: 185237 b: refs/heads/master c: 6219c047d3fe18dee4916d6898fc94f5a7ffd156 h: refs/heads/master i: 185235: e616065fb8a23a29ce6db97abfceeff51dba379c v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-hub.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d29e9460b442..cfc30b989dc5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34fb562a436ca50e13c05e7584c9d62f151052bf +refs/heads/master: 6219c047d3fe18dee4916d6898fc94f5a7ffd156 diff --git a/trunk/drivers/usb/host/xhci-hub.c b/trunk/drivers/usb/host/xhci-hub.c index 5850e8bc30de..208b805b80eb 100644 --- a/trunk/drivers/usb/host/xhci-hub.c +++ b/trunk/drivers/usb/host/xhci-hub.c @@ -129,6 +129,16 @@ static u32 xhci_port_state_to_neutral(u32 state) return (state & XHCI_PORT_RO) | (state & XHCI_PORT_RWS); } +static void xhci_disable_port(struct xhci_hcd *xhci, u16 wIndex, + u32 __iomem *addr, u32 port_status) +{ + /* Write 1 to disable the port */ + xhci_writel(xhci, port_status | PORT_PE, addr); + port_status = xhci_readl(xhci, addr); + xhci_dbg(xhci, "disable port, actual port %d status = 0x%x\n", + wIndex, port_status); +} + static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, u16 wIndex, u32 __iomem *addr, u32 port_status) { @@ -148,6 +158,10 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, status = PORT_OCC; port_change_bit = "over-current"; break; + case USB_PORT_FEAT_C_ENABLE: + status = PORT_PEC; + port_change_bit = "enable/disable"; + break; default: /* Should never happen */ return; @@ -260,9 +274,13 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, case USB_PORT_FEAT_C_RESET: case USB_PORT_FEAT_C_CONNECTION: case USB_PORT_FEAT_C_OVER_CURRENT: + case USB_PORT_FEAT_C_ENABLE: xhci_clear_port_change_bit(xhci, wValue, wIndex, addr, temp); break; + case USB_PORT_FEAT_ENABLE: + xhci_disable_port(xhci, wIndex, addr, temp); + break; default: goto error; }