This is a note to let you know that I've just added the patch titled

     Subject: USB: expand autosuspend/autoresume API

to my gregkh-2.6 tree.  Its filename is

     usb-expand-autosuspend-autoresume-api.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From [EMAIL PROTECTED] Mon Oct 30 14:07:56 2006
Date: Mon, 30 Oct 2006 17:07:51 -0500 (EST)
From: Alan Stern <[EMAIL PROTECTED]>
To: Greg KH <[EMAIL PROTECTED]>, Oliver Neukum <[EMAIL PROTECTED]>
cc: USB development list <linux-usb-devel@lists.sourceforge.net>
Subject: USB: expand autosuspend/autoresume API
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

This patch (as814) adds usb_autopm_set_interface() to the autosuspend
API.  It also provides convenient wrapper routines,
usb_autopm_enable() and usb_autopm_disable(), for drivers that want
to specify directly whether autosuspend should be allowed.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/usb/core/driver.c |   22 ++++++++++++++++++++++
 include/linux/usb.h       |   25 +++++++++++++++++++++++--
 2 files changed, 45 insertions(+), 2 deletions(-)

--- gregkh-2.6.orig/drivers/usb/core/driver.c
+++ gregkh-2.6/drivers/usb/core/driver.c
@@ -1326,6 +1326,28 @@ int usb_autopm_get_interface(struct usb_
 }
 EXPORT_SYMBOL_GPL(usb_autopm_get_interface);
 
+/**
+ * usb_autopm_set_interface - set a USB interface's autosuspend state
+ * @intf: the usb_interface whose state should be set
+ *
+ * This routine sets the autosuspend state of @intf's device according
+ * to @intf's usage counter, which the caller must have set previously.
+ * If the counter is <= 0, the device is autosuspended (if it isn't
+ * already suspended and if nothing else prevents the autosuspend).  If
+ * the counter is > 0, the device is autoresumed (if it isn't already
+ * awake).
+ */
+int usb_autopm_set_interface(struct usb_interface *intf)
+{
+       int     status;
+
+       status = usb_autopm_do_interface(intf, 0);
+       // dev_dbg(&intf->dev, "%s: status %d cnt %d\n",
+       //              __FUNCTION__, status, intf->pm_usage_cnt);
+       return status;
+}
+EXPORT_SYMBOL_GPL(usb_autopm_set_interface);
+
 #endif /* CONFIG_USB_SUSPEND */
 
 static int usb_suspend(struct device *dev, pm_message_t message)
--- gregkh-2.6.orig/include/linux/usb.h
+++ gregkh-2.6/include/linux/usb.h
@@ -415,12 +415,33 @@ extern struct usb_device *usb_find_devic
 
 /* USB autosuspend and autoresume */
 #ifdef CONFIG_USB_SUSPEND
+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);
 
+static inline void usb_autopm_enable(struct usb_interface *intf)
+{
+       intf->pm_usage_cnt = 0;
+       usb_autopm_set_interface(intf);
+}
+
+static inline void usb_autopm_disable(struct usb_interface *intf)
+{
+       intf->pm_usage_cnt = 1;
+       usb_autopm_set_interface(intf);
+}
+
 #else
-#define usb_autopm_get_interface(intf)         0
-#define usb_autopm_put_interface(intf)         do {} while (0)
+
+static inline int usb_autopm_set_interface(struct usb_interface *intf)
+{ return 0; }
+
+static inline int usb_autopm_get_interface(struct usb_interface *intf)
+{ return 0; }
+
+#define usb_autopm_put_interface(intf)                 do {} while (0)
+#define usb_autopm_enable(struct usb_interface *intf)  do {} while (0)
+#define usb_autopm_disable(struct usb_interface *intf) do {} while (0)
 #endif
 
 


Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are

usb/ehci-hcd-fix-budget_pool-allocation-for-machines-with-multiple-ehci-controllers.patch
usb/usb-core-don-t-match-interface-descriptors-for-vendor-specific-devices.patch
usb/usb-hid-handle-stall-on-interrupt-endpoint.patch
usb/usb-takes-31-devices-per-hub.patch
usb/usb-hub-root-hub-code-takes-more-than-15-devices.patch
usb/usb-ohci-disable-rhsc-inside-interrupt-handler.patch
usb/usb-ohci-fix-root-hub-resume-bug.patch
usb/usb-ohci-hcd-fix-compiler-warning.patch
usb/usb-ohci-remove-stale-testing-code-from-root-hub-resume.patch
usb/usb-autosuspend-code-consolidation.patch
usb/usb-expand-autosuspend-autoresume-api.patch
g-usb-hub-autosuspend-autoresume.patch
g-ehci-repair-remote-wakeup-support.patch

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to