Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28315
b: refs/heads/master
c: 4489a57
h: refs/heads/master
i:
  28313: 64a46bc
  28311: 9e0d977
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent cb7e841 commit 7cfba0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9effa978f1d51f6d0426ebabcf6cb32336bb3153
refs/heads/master: 4489a5712b086621a6c3f669057d2996245cd3fb
23 changes: 15 additions & 8 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,22 @@ static void hub_power_on(struct usb_hub *hub)
{
int port1;
unsigned pgood_delay = hub->descriptor->bPwrOn2PwrGood * 2;
u16 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics);

/* if hub supports power switching, enable power on each port */
if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2) {
u16 wHubCharacteristics =
le16_to_cpu(hub->descriptor->wHubCharacteristics);

/* Enable power on each port. Some hubs have reserved values
* of LPSM (> 2) in their descriptors, even though they are
* USB 2.0 hubs. Some hubs do not implement port-power switching
* but only emulate it. In all cases, the ports won't work
* unless we send these messages to the hub.
*/
if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2)
dev_dbg(hub->intfdev, "enabling power on all ports\n");
for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++)
set_port_feature(hub->hdev, port1,
USB_PORT_FEAT_POWER);
}
else
dev_dbg(hub->intfdev, "trying to enable port power on "
"non-switchable hub\n");
for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++)
set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);

/* Wait at least 100 msec for power to become stable */
msleep(max(pgood_delay, (unsigned) 100));
Expand Down

0 comments on commit 7cfba0e

Please sign in to comment.