USB: implement usb_enable_autosuspend
This patch (as1326) adds usb_enable_autosuspend() and usb_disable_autosuspend() routines for use by drivers. If a driver knows that its device can handle suspends and resumes correctly, it can enable autosuspend all by itself. This is equivalent to the user writing "auto" to the device's power/level attribute. The implementation differs slightly from what it used to be. Now autosuspend is disabled simply by doing usb_autoresume_device() (to increment the usage counter) and enabled by doing usb_autosuspend_device() (to decrement the usage counter). The set_level() attribute method is updated to use the new routines, and the USB Power-Management documentation is updated. The patch adds a usb_enable_autosuspend() call to the hub driver's probe routine, allowing the special-case code for hubs in quirks.c to be removed. Signed-off-by:Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
Showing
- Documentation/usb/power-management.txt 18 additions, 0 deletionsDocumentation/usb/power-management.txt
- drivers/usb/core/driver.c 42 additions, 0 deletionsdrivers/usb/core/driver.c
- drivers/usb/core/hub.c 3 additions, 0 deletionsdrivers/usb/core/hub.c
- drivers/usb/core/quirks.c 4 additions, 5 deletionsdrivers/usb/core/quirks.c
- drivers/usb/core/sysfs.c 7 additions, 16 deletionsdrivers/usb/core/sysfs.c
- include/linux/usb.h 8 additions, 0 deletionsinclude/linux/usb.h
Loading
Please register or sign in to comment