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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 23:35:09 +0000 (16:35 -0700)
commit9262c19d14c433a6a1ba25c3ff897cb89e412309
tree50f83b859b251a3e842953e4fb9619a05ece02da
parent600856c231ccb0cbf8afcf09066a8ab2a93ab03d
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>
drivers/usb/core/hub.c
drivers/usb/core/hub.h
drivers/usb/core/port.c