]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
USB: add RESET_RESUME device quirk
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 4 May 2007 15:53:03 +0000 (11:53 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jul 2007 23:29:47 +0000 (16:29 -0700)
This patch (as888) adds a new USB device quirk for devices which are
unable to resume correctly.  By using the new code added for the
USB-persist facility, it is a simple matter to reset these devices
instead of resuming them.  To get things kicked off, a quirk entry is
added for the Philips PSC805.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
include/linux/usb/quirks.h

index 12dd986bdffdade37b7ad99b343185efb1474d71..02d6db61c940a03623f46add7b10ad4c1a406d93 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/device.h>
 #include <linux/usb.h>
+#include <linux/usb/quirks.h>
 #include <linux/workqueue.h>
 #include "hcd.h"
 #include "usb.h"
@@ -835,6 +836,9 @@ static int usb_resume_device(struct usb_device *udev)
                goto done;
        }
 
+       if (udev->quirks & USB_QUIRK_RESET_RESUME)
+               udev->reset_resume = 1;
+
        udriver = to_usb_device_driver(udev->dev.driver);
        status = udriver->resume(udev);
 
index 51d2d304568b9b40daab6f750587379ca53d4216..d37ad083d5ef0a3b98c41a06e4e316d13c3ab07e 100644 (file)
@@ -2939,6 +2939,11 @@ static int config_descriptors_changed(struct usb_device *udev)
  * this from a driver probe() routine after downloading new firmware.
  * For calls that might not occur during probe(), drivers should lock
  * the device using usb_lock_device_for_reset().
+ *
+ * Locking exception: This routine may also be called from within an
+ * autoresume handler.  Such usage won't conflict with other tasks
+ * holding the device lock because these tasks should always call
+ * usb_autopm_resume_device(), thereby preventing any unwanted autoresume.
  */
 int usb_reset_device(struct usb_device *udev)
 {
index 739f520908aa939b30a09e54bd3a9627b6ceb0a5..f37fa012f3296b1f55ec5b2317f6689bb436b0fa 100644 (file)
@@ -35,6 +35,9 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* Elsa MicroLink 56k (V.250) */
        { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
 
+       /* Philips PSC805 audio device */
+       { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
+
        { }  /* terminating entry must be last */
 };
 
index 6bac8faacbc6e8f00de074e62735f801a8213686..8da374caf582aeb3136c5d3f90722906ca8fa2dd 100644 (file)
@@ -9,3 +9,6 @@
 
 /* string descriptors must not be fetched using a 255-byte read */
 #define USB_QUIRK_STRING_FETCH_255     0x00000002
+
+/* device can't resume correctly so reset it instead */
+#define USB_QUIRK_RESET_RESUME         0x00000004