Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[sfrench/cifs-2.6.git] / drivers / usb / host / ohci-hcd.c
index afe59be2364594357fb5fbb875d95d4838059fce..c3b4ccc7337b54577f6ae0d9c5ab934f9359d27f 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/list.h>
 #include <linux/usb.h>
 #include <linux/usb/otg.h>
+#include <linux/usb/hcd.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
 #include <linux/workqueue.h>
@@ -43,7 +44,6 @@
 #include <asm/unaligned.h>
 #include <asm/byteorder.h>
 
-#include "../core/hcd.h"
 
 #define DRIVER_AUTHOR "Roman Weissgaerber, David Brownell"
 #define DRIVER_DESC "USB 1.1 'Open' Host Controller (OHCI) Driver"
@@ -212,7 +212,7 @@ static int ohci_urb_enqueue (
        spin_lock_irqsave (&ohci->lock, flags);
 
        /* don't submit to a dead HC */
-       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+       if (!HCD_HW_ACCESSIBLE(hcd)) {
                retval = -ENODEV;
                goto fail;
        }
@@ -685,7 +685,7 @@ retry:
        }
 
        /* use rhsc irqs after khubd is fully initialized */
-       hcd->poll_rh = 1;
+       set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
        hcd->uses_new_polling = 1;
 
        /* start controller operations */
@@ -822,7 +822,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
        else if (ints & OHCI_INTR_RD) {
                ohci_vdbg(ohci, "resume detect\n");
                ohci_writel(ohci, OHCI_INTR_RD, &regs->intrstatus);
-               hcd->poll_rh = 1;
+               set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
                if (ohci->autostop) {
                        spin_lock (&ohci->lock);
                        ohci_rh_resume (ohci);
@@ -1006,9 +1006,14 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER                ohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_ARCH_OMAP
+#ifdef CONFIG_USB_OHCI_HCD_OMAP1
 #include "ohci-omap.c"
-#define PLATFORM_DRIVER                ohci_hcd_omap_driver
+#define OMAP1_PLATFORM_DRIVER  ohci_hcd_omap_driver
+#endif
+
+#ifdef CONFIG_USB_OHCI_HCD_OMAP3
+#include "ohci-omap3.c"
+#define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
 #endif
 
 #ifdef CONFIG_ARCH_LH7A404
@@ -1026,7 +1031,7 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER                ohci_hcd_ep93xx_driver
 #endif
 
-#ifdef CONFIG_SOC_AU1X00
+#ifdef CONFIG_MIPS_ALCHEMY
 #include "ohci-au1xxx.c"
 #define PLATFORM_DRIVER                ohci_hcd_au1xxx_driver
 #endif
@@ -1090,8 +1095,15 @@ MODULE_LICENSE ("GPL");
 #define TMIO_OHCI_DRIVER       ohci_hcd_tmio_driver
 #endif
 
+#ifdef CONFIG_MACH_JZ4740
+#include "ohci-jz4740.c"
+#define PLATFORM_DRIVER        ohci_hcd_jz4740_driver
+#endif
+
 #if    !defined(PCI_DRIVER) &&         \
        !defined(PLATFORM_DRIVER) &&    \
+       !defined(OMAP1_PLATFORM_DRIVER) &&      \
+       !defined(OMAP3_PLATFORM_DRIVER) &&      \
        !defined(OF_PLATFORM_DRIVER) && \
        !defined(SA1111_DRIVER) &&      \
        !defined(PS3_SYSTEM_BUS_DRIVER) && \
@@ -1133,6 +1145,18 @@ static int __init ohci_hcd_mod_init(void)
                goto error_platform;
 #endif
 
+#ifdef OMAP1_PLATFORM_DRIVER
+       retval = platform_driver_register(&OMAP1_PLATFORM_DRIVER);
+       if (retval < 0)
+               goto error_omap1_platform;
+#endif
+
+#ifdef OMAP3_PLATFORM_DRIVER
+       retval = platform_driver_register(&OMAP3_PLATFORM_DRIVER);
+       if (retval < 0)
+               goto error_omap3_platform;
+#endif
+
 #ifdef OF_PLATFORM_DRIVER
        retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
        if (retval < 0)
@@ -1200,6 +1224,14 @@ static int __init ohci_hcd_mod_init(void)
        platform_driver_unregister(&PLATFORM_DRIVER);
  error_platform:
 #endif
+#ifdef OMAP1_PLATFORM_DRIVER
+       platform_driver_unregister(&OMAP1_PLATFORM_DRIVER);
+ error_omap1_platform:
+#endif
+#ifdef OMAP3_PLATFORM_DRIVER
+       platform_driver_unregister(&OMAP3_PLATFORM_DRIVER);
+ error_omap3_platform:
+#endif
 #ifdef PS3_SYSTEM_BUS_DRIVER
        ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
  error_ps3: