]> git.baikalelectronics.ru Git - kernel.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>
Tue, 2 Mar 2010 22:53:35 +0000 (14:53 -0800)
commit4efea8fad33c4841d2cfe8e7bce52d729c6d5db9
tree1db9d25a5e4319c3fb85d9e71a736e76ad8dc0b0
parent47c7704e7bf00179230a44bb420ff49b6a7ee309
USB: retain USB device power/wakeup setting across reconfiguration

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>
drivers/usb/core/hub.c