]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-hcd.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-hcd.c
index ddd4ee1f2413633bccd1ae9d9309a2a7a86b9e32..89901962cbfd821bc454353f61ed1e4e66ecf8db 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/dmapool.h>
 #include <linux/reboot.h>
 #include <linux/workqueue.h>
+#include <linux/debugfs.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -85,6 +86,21 @@ static void ohci_stop (struct usb_hcd *hcd);
 static int ohci_restart (struct ohci_hcd *ohci);
 #endif
 
+#ifdef CONFIG_PCI
+static void quirk_amd_pll(int state);
+static void amd_iso_dev_put(void);
+#else
+static inline void quirk_amd_pll(int state)
+{
+       return;
+}
+static inline void amd_iso_dev_put(void)
+{
+       return;
+}
+#endif
+
+
 #include "ohci-hub.c"
 #include "ohci-dbg.c"
 #include "ohci-mem.c"
@@ -466,7 +482,7 @@ static void unlink_watchdog_func(unsigned long _ohci)
 out:
        kfree(seen);
        if (ohci->eds_scheduled)
-               mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ));
+               mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
 done:
        spin_unlock_irqrestore(&ohci->lock, flags);
 }
@@ -482,6 +498,9 @@ static int ohci_init (struct ohci_hcd *ohci)
        int ret;
        struct usb_hcd *hcd = ohci_to_hcd(ohci);
 
+       if (distrust_firmware)
+               ohci->flags |= OHCI_QUIRK_HUB_POWER;
+
        disable (ohci);
        ohci->regs = hcd->regs;
 
@@ -688,7 +707,8 @@ retry:
                temp |= RH_A_NOCP;
                temp &= ~(RH_A_POTPGT | RH_A_NPS);
                ohci_writel (ohci, temp, &ohci->regs->roothub.a);
-       } else if ((ohci->flags & OHCI_QUIRK_AMD756) || distrust_firmware) {
+       } else if ((ohci->flags & OHCI_QUIRK_AMD756) ||
+                       (ohci->flags & OHCI_QUIRK_HUB_POWER)) {
                /* hub power always on; required for AMD-756 and some
                 * Mac platforms.  ganged overcurrent reporting, if any.
                 */
@@ -809,13 +829,9 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
        }
 
        if (ints & OHCI_INTR_WDH) {
-               if (HC_IS_RUNNING(hcd->state))
-                       ohci_writel (ohci, OHCI_INTR_WDH, &regs->intrdisable);
                spin_lock (&ohci->lock);
                dl_done_list (ohci);
                spin_unlock (&ohci->lock);
-               if (HC_IS_RUNNING(hcd->state))
-                       ohci_writel (ohci, OHCI_INTR_WDH, &regs->intrenable);
        }
 
        if (quirk_zfmicro(ohci) && (ints & OHCI_INTR_SF)) {
@@ -885,6 +901,8 @@ static void ohci_stop (struct usb_hcd *hcd)
 
        if (quirk_zfmicro(ohci))
                del_timer(&ohci->unlink_watchdog);
+       if (quirk_amdiso(ohci))
+               amd_iso_dev_put();
 
        remove_debug_files (ohci);
        ohci_mem_cleanup (ohci);
@@ -977,7 +995,7 @@ MODULE_LICENSE ("GPL");
 #define PCI_DRIVER             ohci_pci_driver
 #endif
 
-#ifdef CONFIG_SA1111
+#if defined(CONFIG_ARCH_SA1100) && defined(CONFIG_SA1111)
 #include "ohci-sa1111.c"
 #define SA1111_DRIVER          ohci_hcd_sa1111_driver
 #endif
@@ -1032,6 +1050,13 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER                usb_hcd_pnx4008_driver
 #endif
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7721) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7763)
+#include "ohci-sh.c"
+#define PLATFORM_DRIVER                ohci_hcd_sh_driver
+#endif
+
 
 #ifdef CONFIG_USB_OHCI_HCD_PPC_OF
 #include "ohci-ppc-of.c"
@@ -1048,11 +1073,17 @@ MODULE_LICENSE ("GPL");
 #define SSB_OHCI_DRIVER                ssb_ohci_driver
 #endif
 
+#ifdef CONFIG_MFD_SM501
+#include "ohci-sm501.c"
+#define SM501_OHCI_DRIVER      ohci_hcd_sm501_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(SSB_OHCI_DRIVER)
 #error "missing bus glue for ohci-hcd"
 #endif
@@ -1068,6 +1099,14 @@ static int __init ohci_hcd_mod_init(void)
        pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
                sizeof (struct ed), sizeof (struct td));
 
+#ifdef DEBUG
+       ohci_debug_root = debugfs_create_dir("ohci", NULL);
+       if (!ohci_debug_root) {
+               retval = -ENOENT;
+               goto error_debug;
+       }
+#endif
+
 #ifdef PS3_SYSTEM_BUS_DRIVER
        retval = ps3_ohci_driver_register(&PS3_SYSTEM_BUS_DRIVER);
        if (retval < 0)
@@ -1104,9 +1143,18 @@ static int __init ohci_hcd_mod_init(void)
                goto error_ssb;
 #endif
 
+#ifdef SM501_OHCI_DRIVER
+       retval = platform_driver_register(&SM501_OHCI_DRIVER);
+       if (retval < 0)
+               goto error_sm501;
+#endif
+
        return retval;
 
        /* Error path */
+#ifdef SM501_OHCI_DRIVER
+ error_sm501:
+#endif
 #ifdef SSB_OHCI_DRIVER
  error_ssb:
 #endif
@@ -1130,12 +1178,21 @@ static int __init ohci_hcd_mod_init(void)
        ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
  error_ps3:
 #endif
+#ifdef DEBUG
+       debugfs_remove(ohci_debug_root);
+       ohci_debug_root = NULL;
+ error_debug:
+#endif
+
        return retval;
 }
 module_init(ohci_hcd_mod_init);
 
 static void __exit ohci_hcd_mod_exit(void)
 {
+#ifdef SM501_OHCI_DRIVER
+       platform_driver_unregister(&SM501_OHCI_DRIVER);
+#endif
 #ifdef SSB_OHCI_DRIVER
        ssb_driver_unregister(&SSB_OHCI_DRIVER);
 #endif
@@ -1154,6 +1211,9 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef PS3_SYSTEM_BUS_DRIVER
        ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
 #endif
+#ifdef DEBUG
+       debugfs_remove(ohci_debug_root);
+#endif
 }
 module_exit(ohci_hcd_mod_exit);