]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: retain USB device power/wakeup setting across reconfiguration
authorDan Streetman <ddstreet@ieee.org>
Wed, 6 Jan 2010 14:56:53 +0000 (09:56 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:55:10 +0000 (15:55 -0700)
commita30ded70e8160aa6dc8d0c1d4c9dacc47a38fee3
treeed3ba8cf95b9d13f7d4f37e26488a715a46c8c68
parent89822670f6cf3d499577b7a25dea8c6c8f202a8d
USB: retain USB device power/wakeup setting across reconfiguration

commit 16985408b5c48585762ec3b9b7bae1dec4ad7437 upstream.

Currently a non-root-hub USB device's wakeup settings are initialized when the
device is set to a configured state using device_init_wakeup(), but this is not
correct as wakeup is split into "capable" (can_wakeup) and "enabled"
(should_wakeup).  The settings should be initialized instead in the device
initialization (usb_new_device) with the "capable" setting disabled and the
"enabled" setting enabled.  The "capable" setting should be set based on the
device being configured or unconfigured, and "enabled" setting set based on
the sysfs power/wakeup control.

This patch retains the sysfs power/wakeup setting of a non-root-hub USB device
over a USB device re-configuration, which can happen (for example) after a
suspend/resume cycle.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[bwh: Adjust context for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hub.c