usb: disable port power control if not supported in wHubCharacteristics
authorDan Williams <dan.j.williams@intel.com>
Wed, 21 May 2014 01:08:12 +0000 (18:08 -0700)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 5 Dec 2014 04:13:28 +0000 (13:13 +0900)
commit2862caa8ce45d9da058be5186d0fde1c1e7f1807
treee1f1bcb5221e47d75bd0fc4965227f643ac9601c
parentec9b9398b427f9c7b5d285d382d501a3b15998cc
usb: disable port power control if not supported in wHubCharacteristics

A hub indicates whether it supports per-port power control via the
wHubCharacteristics field in its descriptor.  If it is not supported
a hub will still emulate ClearPortPower(PORT_POWER) requests by
stopping the link state machine.  However, since this does not save
power do not bother suspending.

This also consolidates support checks into a
hub_is_port_power_switchable() helper.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9262c19d14c433a6a1ba25c3ff897cb89e412309)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/usb/core/hub.c
drivers/usb/core/hub.h
drivers/usb/core/port.c