USB: make autosuspend delay a module parameter

This patch (as859) makes the default USB autosuspend delay a module
parameter of usbcore.  By setting the delay value at boot time, users
will be able to prevent the system from autosuspending devices which
for some reason can't handle it.

The patch also stores the autosuspend delay as a per-device value.  A
later patch will allow the user to change the value, tailoring the
delay for each individual device.  A delay value of 0 will prevent
autosuspend.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern
2007-02-20 15:00:53 -05:00
committed by Greg Kroah-Hartman
parent aa084f3efe
commit b5e795f8df
6 changed files with 36 additions and 10 deletions

View File

@ -39,8 +39,10 @@ static const struct usb_device_id usb_quirk_list[] = {
static void usb_autosuspend_quirk(struct usb_device *udev)
{
/* unbalanced resume to prevent autosuspends */
usb_autoresume_device(udev);
#ifdef CONFIG_USB_SUSPEND
/* disable autosuspend, but allow the user to re-enable it via sysfs */
udev->autosuspend_delay = 0;
#endif
}
static const struct usb_device_id *find_id(struct usb_device *udev)