]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-hcd.c
USB: don't enable wakeup by default for PCI host controllers
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-hcd.c
index 8647dab0d7f900d2e3dc3da53159068903418178..5cf5f1eca4f40d4288d1127647723eb11a6c7781 100644 (file)
@@ -589,14 +589,14 @@ static int ohci_run (struct ohci_hcd *ohci)
                /* also: power/overcurrent flags in roothub.a */
        }
 
-       /* Reset USB nearly "by the book".  RemoteWakeupConnected was
-        * saved if boot firmware (BIOS/SMM/...) told us it's connected,
-        * or if bus glue did the same (e.g. for PCI add-in cards with
-        * PCI PM support).
+       /* Reset USB nearly "by the book".  RemoteWakeupConnected has
+        * to be checked in case boot firmware (BIOS/SMM/...) has set up
+        * wakeup in a way the bus isn't aware of (e.g., legacy PCI PM).
+        * If the bus glue detected wakeup capability then it should
+        * already be enabled; if so we'll just enable it again.
         */
-       if ((ohci->hc_control & OHCI_CTRL_RWC) != 0
-                       && !device_may_wakeup(hcd->self.controller))
-               device_init_wakeup(hcd->self.controller, 1);
+       if ((ohci->hc_control & OHCI_CTRL_RWC) != 0)
+               device_set_wakeup_capable(hcd->self.controller, 1);
 
        switch (ohci->hc_control & OHCI_CTRL_HCFS) {
        case OHCI_USB_OPER:
@@ -1075,12 +1075,18 @@ MODULE_LICENSE ("GPL");
 #define SM501_OHCI_DRIVER      ohci_hcd_sm501_driver
 #endif
 
+#ifdef CONFIG_MFD_TC6393XB
+#include "ohci-tmio.c"
+#define TMIO_OHCI_DRIVER       ohci_hcd_tmio_driver
+#endif
+
 #if    !defined(PCI_DRIVER) &&         \
        !defined(PLATFORM_DRIVER) &&    \
        !defined(OF_PLATFORM_DRIVER) && \
        !defined(SA1111_DRIVER) &&      \
        !defined(PS3_SYSTEM_BUS_DRIVER) && \
        !defined(SM501_OHCI_DRIVER) && \
+       !defined(TMIO_OHCI_DRIVER) && \
        !defined(SSB_OHCI_DRIVER)
 #error "missing bus glue for ohci-hcd"
 #endif
@@ -1147,13 +1153,25 @@ static int __init ohci_hcd_mod_init(void)
                goto error_sm501;
 #endif
 
+#ifdef TMIO_OHCI_DRIVER
+       retval = platform_driver_register(&TMIO_OHCI_DRIVER);
+       if (retval < 0)
+               goto error_tmio;
+#endif
+
        return retval;
 
        /* Error path */
+#ifdef TMIO_OHCI_DRIVER
+       platform_driver_unregister(&TMIO_OHCI_DRIVER);
+ error_tmio:
+#endif
 #ifdef SM501_OHCI_DRIVER
+       platform_driver_unregister(&SM501_OHCI_DRIVER);
  error_sm501:
 #endif
 #ifdef SSB_OHCI_DRIVER
+       ssb_driver_unregister(&SSB_OHCI_DRIVER);
  error_ssb:
 #endif
 #ifdef PCI_DRIVER
@@ -1189,6 +1207,9 @@ module_init(ohci_hcd_mod_init);
 
 static void __exit ohci_hcd_mod_exit(void)
 {
+#ifdef TMIO_OHCI_DRIVER
+       platform_driver_unregister(&TMIO_OHCI_DRIVER);
+#endif
 #ifdef SM501_OHCI_DRIVER
        platform_driver_unregister(&SM501_OHCI_DRIVER);
 #endif