]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci.h
index 0dafcda3729126320e46918e79411d2acc8a6555..dc544ddc784962831637e749c4d50420ee24aa0b 100644 (file)
@@ -397,10 +397,46 @@ struct ohci_hcd {
 #define        OHCI_QUIRK_BE_DESC      0x08                    /* BE descriptors */
 #define        OHCI_QUIRK_BE_MMIO      0x10                    /* BE registers */
 #define        OHCI_QUIRK_ZFMICRO      0x20                    /* Compaq ZFMicro chipset*/
+#define        OHCI_QUIRK_NEC          0x40                    /* lost interrupts */
+#define        OHCI_QUIRK_FRAME_NO     0x80                    /* no big endian frame_no shift */
        // there are also chip quirks/bugs in init logic
 
+       struct work_struct      nec_work;       /* Worker for NEC quirk */
+
+       /* Needed for ZF Micro quirk */
+       struct timer_list       unlink_watchdog;
+       unsigned                eds_scheduled;
+       struct ed               *ed_to_check;
+       unsigned                zf_delay;
+
+#ifdef DEBUG
+       struct dentry           *debug_dir;
+       struct dentry           *debug_async;
+       struct dentry           *debug_periodic;
+       struct dentry           *debug_registers;
+#endif
 };
 
+#ifdef CONFIG_PCI
+static inline int quirk_nec(struct ohci_hcd *ohci)
+{
+       return ohci->flags & OHCI_QUIRK_NEC;
+}
+static inline int quirk_zfmicro(struct ohci_hcd *ohci)
+{
+       return ohci->flags & OHCI_QUIRK_ZFMICRO;
+}
+#else
+static inline int quirk_nec(struct ohci_hcd *ohci)
+{
+       return 0;
+}
+static inline int quirk_zfmicro(struct ohci_hcd *ohci)
+{
+       return 0;
+}
+#endif
+
 /* convert between an hcd pointer and the corresponding ohci_hcd */
 static inline struct ohci_hcd *hcd_to_ohci (struct usb_hcd *hcd)
 {
@@ -507,10 +543,10 @@ static inline unsigned int _ohci_readl (const struct ohci_hcd *ohci,
 {
 #ifdef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
        return big_endian_mmio(ohci) ?
-               readl_be ((__force u32 *)regs) :
-               readl ((__force u32 *)regs);
+               readl_be (regs) :
+               readl (regs);
 #else
-       return readl ((__force u32 *)regs);
+       return readl (regs);
 #endif
 }
 
@@ -519,10 +555,10 @@ static inline void _ohci_writel (const struct ohci_hcd *ohci,
 {
 #ifdef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
        big_endian_mmio(ohci) ?
-               writel_be (val, (__force u32 *)regs) :
-               writel (val, (__force u32 *)regs);
+               writel_be (val, regs) :
+               writel (val, regs);
 #else
-               writel (val, (__force u32 *)regs);
+               writel (val, regs);
 #endif
 }
 
@@ -605,15 +641,12 @@ static inline u32 hc32_to_cpup (const struct ohci_hcd *ohci, const __hc32 *x)
 /* HCCA frame number is 16 bits, but is accessed as 32 bits since not all
  * hardware handles 16 bit reads.  That creates a different confusion on
  * some big-endian SOC implementations.  Same thing happens with PSW access.
- *
- * FIXME: Deal with that as a runtime quirk when STB03xxx is ported over
- * to arch/powerpc
  */
 
-#ifdef CONFIG_STB03xxx
-#define OHCI_BE_FRAME_NO_SHIFT 16
+#ifdef CONFIG_PPC_MPC52xx
+#define big_endian_frame_no_quirk(ohci)        (ohci->flags & OHCI_QUIRK_FRAME_NO)
 #else
-#define OHCI_BE_FRAME_NO_SHIFT 0
+#define big_endian_frame_no_quirk(ohci)        0
 #endif
 
 static inline u16 ohci_frame_no(const struct ohci_hcd *ohci)
@@ -621,7 +654,8 @@ static inline u16 ohci_frame_no(const struct ohci_hcd *ohci)
        u32 tmp;
        if (big_endian_desc(ohci)) {
                tmp = be32_to_cpup((__force __be32 *)&ohci->hcca->frame_no);
-               tmp >>= OHCI_BE_FRAME_NO_SHIFT;
+               if (!big_endian_frame_no_quirk(ohci))
+                       tmp >>= 16;
        } else
                tmp = le32_to_cpup((__force __le32 *)&ohci->hcca->frame_no);