diff options
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch')
-rw-r--r-- | meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch new file mode 100644 index 0000000000..0073343d10 --- /dev/null +++ b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | commit 0f592e33934bf6108e33e34f00b425f98ee833ef | ||
2 | Author: Matthew Garrett <mjg@redhat.com> | ||
3 | Date: Wed Jul 8 19:04:23 2009 +0100 | ||
4 | |||
5 | usb: Allow drivers to enable USB autosuspend on a per-device basis | ||
6 | |||
7 | USB autosuspend is currently only enabled by default for hubs. On other | ||
8 | hardware the decision is made by userspace. This is unnecessary in cases | ||
9 | where we know that the hardware supports autosuspend, so this patch adds | ||
10 | a function to allow drivers to enable it at probe time. | ||
11 | |||
12 | Signed-off-by: Matthew Garrett <mjg@redhat.com> | ||
13 | |||
14 | diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c | ||
15 | index 69e5773..6e81caa 100644 | ||
16 | --- a/drivers/usb/core/driver.c | ||
17 | +++ b/drivers/usb/core/driver.c | ||
18 | @@ -1560,6 +1560,21 @@ void usb_autopm_put_interface_async(struct usb_interface *intf) | ||
19 | EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async); | ||
20 | |||
21 | /** | ||
22 | + * usb_device_autosuspend_enable - enable autosuspend on a device | ||
23 | + * @udev: the usb_device to be autosuspended | ||
24 | + * | ||
25 | + * This routine should be called by an interface driver when it knows that | ||
26 | + * the device in question supports USB autosuspend. | ||
27 | + * | ||
28 | + */ | ||
29 | +void usb_device_autosuspend_enable(struct usb_device *udev) | ||
30 | +{ | ||
31 | + udev->autosuspend_disabled = 0; | ||
32 | + udev->autoresume_disabled = 0; | ||
33 | +} | ||
34 | +EXPORT_SYMBOL_GPL(usb_device_autosuspend_enable); | ||
35 | + | ||
36 | +/** | ||
37 | * usb_autopm_get_interface - increment a USB interface's PM-usage counter | ||
38 | * @intf: the usb_interface whose counter should be incremented | ||
39 | * | ||
40 | diff --git a/include/linux/usb.h b/include/linux/usb.h | ||
41 | index b1e3c2f..61bddbe 100644 | ||
42 | --- a/include/linux/usb.h | ||
43 | +++ b/include/linux/usb.h | ||
44 | @@ -543,6 +543,7 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | ||
45 | |||
46 | /* USB autosuspend and autoresume */ | ||
47 | #ifdef CONFIG_USB_SUSPEND | ||
48 | +extern void usb_device_autosuspend_enable(struct usb_device *udev); | ||
49 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
50 | extern int usb_autopm_get_interface(struct usb_interface *intf); | ||
51 | extern void usb_autopm_put_interface(struct usb_interface *intf); | ||
52 | @@ -568,6 +569,9 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | ||
53 | |||
54 | #else | ||
55 | |||
56 | +static inline void usb_device_autosuspend_enable(struct usb_device *udev) | ||
57 | +{ } | ||
58 | + | ||
59 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
60 | { return 0; } | ||
61 | |||