diff options
Diffstat (limited to 'Documentation/usb')
-rw-r--r-- | Documentation/usb/power-management.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index 3bf6818c8cf5..e3fa189c257a 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -229,6 +229,11 @@ necessary operations by hand or add them to a udev script. You can | |||
229 | also change the idle-delay time; 2 seconds is not the best choice for | 229 | also change the idle-delay time; 2 seconds is not the best choice for |
230 | every device. | 230 | every device. |
231 | 231 | ||
232 | If a driver knows that its device has proper suspend/resume support, | ||
233 | it can enable autosuspend all by itself. For example, the video | ||
234 | driver for a laptop's webcam might do this, since these devices are | ||
235 | rarely used and so should normally be autosuspended. | ||
236 | |||
232 | Sometimes it turns out that even when a device does work okay with | 237 | Sometimes it turns out that even when a device does work okay with |
233 | autosuspend there are still problems. For example, there are | 238 | autosuspend there are still problems. For example, there are |
234 | experimental patches adding autosuspend support to the usbhid driver, | 239 | experimental patches adding autosuspend support to the usbhid driver, |
@@ -384,6 +389,19 @@ autosuspend, there's no delay for an autoresume. | |||
384 | Other parts of the driver interface | 389 | Other parts of the driver interface |
385 | ----------------------------------- | 390 | ----------------------------------- |
386 | 391 | ||
392 | Drivers can enable autosuspend for their devices by calling | ||
393 | |||
394 | usb_enable_autosuspend(struct usb_device *udev); | ||
395 | |||
396 | in their probe() routine, if they know that the device is capable of | ||
397 | suspending and resuming correctly. This is exactly equivalent to | ||
398 | writing "auto" to the device's power/level attribute. Likewise, | ||
399 | drivers can disable autosuspend by calling | ||
400 | |||
401 | usb_disable_autosuspend(struct usb_device *udev); | ||
402 | |||
403 | This is exactly the same as writing "on" to the power/level attribute. | ||
404 | |||
387 | Sometimes a driver needs to make sure that remote wakeup is enabled | 405 | Sometimes a driver needs to make sure that remote wakeup is enabled |
388 | during autosuspend. For example, there's not much point | 406 | during autosuspend. For example, there's not much point |
389 | autosuspending a keyboard if the user can't cause the keyboard to do a | 407 | autosuspending a keyboard if the user can't cause the keyboard to do a |