summaryrefslogtreecommitdiff
path: root/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-26 15:59:18 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-26 15:59:18 +0000
commit684d263e75a6a7ede638afa60e35a238e24c12ba (patch)
tree5ab1d38848909494b693e31d0a29659bcaa365e4 /meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6-driver-level-usb-autosuspend.patch
parent3a32c2c6e9d1d9823971a17c0ee8f8839bd79b1f (diff)
downloadopenembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.gz
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.bz2
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.tar.xz
openembedded-core-684d263e75a6a7ede638afa60e35a238e24c12ba.zip
linux-moblin: Add 2.6.31.5
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
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.patch61
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 000000000..0073343d1
--- /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 @@
+commit 0f592e33934bf6108e33e34f00b425f98ee833ef
+Author: Matthew Garrett <mjg@redhat.com>
+Date: Wed Jul 8 19:04:23 2009 +0100
+
+ usb: Allow drivers to enable USB autosuspend on a per-device basis
+
+ USB autosuspend is currently only enabled by default for hubs. On other
+ hardware the decision is made by userspace. This is unnecessary in cases
+ where we know that the hardware supports autosuspend, so this patch adds
+ a function to allow drivers to enable it at probe time.
+
+ Signed-off-by: Matthew Garrett <mjg@redhat.com>
+
+diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
+index 69e5773..6e81caa 100644
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -1560,6 +1560,21 @@ void usb_autopm_put_interface_async(struct usb_interface *intf)
+ EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async);
+
+ /**
++ * usb_device_autosuspend_enable - enable autosuspend on a device
++ * @udev: the usb_device to be autosuspended
++ *
++ * This routine should be called by an interface driver when it knows that
++ * the device in question supports USB autosuspend.
++ *
++ */
++void usb_device_autosuspend_enable(struct usb_device *udev)
++{
++ udev->autosuspend_disabled = 0;
++ udev->autoresume_disabled = 0;
++}
++EXPORT_SYMBOL_GPL(usb_device_autosuspend_enable);
++
++/**
+ * usb_autopm_get_interface - increment a USB interface's PM-usage counter
+ * @intf: the usb_interface whose counter should be incremented
+ *
+diff --git a/include/linux/usb.h b/include/linux/usb.h
+index b1e3c2f..61bddbe 100644
+--- a/include/linux/usb.h
++++ b/include/linux/usb.h
+@@ -543,6 +543,7 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
+
+ /* USB autosuspend and autoresume */
+ #ifdef CONFIG_USB_SUSPEND
++extern void usb_device_autosuspend_enable(struct usb_device *udev);
+ extern int usb_autopm_set_interface(struct usb_interface *intf);
+ extern int usb_autopm_get_interface(struct usb_interface *intf);
+ extern void usb_autopm_put_interface(struct usb_interface *intf);
+@@ -568,6 +569,9 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
+
+ #else
+
++static inline void usb_device_autosuspend_enable(struct usb_device *udev)
++{ }
++
+ static inline int usb_autopm_set_interface(struct usb_interface *intf)
+ { return 0; }
+