]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ehci.h
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ehci.h
index c7d4b5a06bdb049e424228560a9d0b51f4baf7fd..fb7054ccf4fce90c516397f9923e6195c149768e 100644 (file)
@@ -120,6 +120,16 @@ struct ehci_hcd {                  /* one per controller */
        unsigned                has_fsl_port_bug:1; /* FreeScale */
        unsigned                big_endian_mmio:1;
        unsigned                big_endian_desc:1;
+       unsigned                has_amcc_usb23:1;
+
+       /* required for usb32 quirk */
+       #define OHCI_CTRL_HCFS          (3 << 6)
+       #define OHCI_USB_OPER           (2 << 6)
+       #define OHCI_USB_SUSPEND        (3 << 6)
+
+       #define OHCI_HCCTRL_OFFSET      0x4
+       #define OHCI_HCCTRL_LEN         0x4
+       __hc32                  *ohci_hcctrl_reg;
 
        u8                      sbrn;           /* packed release number */
 
@@ -636,6 +646,30 @@ static inline void ehci_writel(const struct ehci_hcd *ehci,
 #endif
 }
 
+/*
+ * On certain ppc-44x SoC there is a HW issue, that could only worked around with
+ * explicit suspend/operate of OHCI. This function hereby makes sense only on that arch.
+ * Other common bits are dependant on has_amcc_usb23 quirk flag.
+ */
+#ifdef CONFIG_44x
+static inline void set_ohci_hcfs(struct ehci_hcd *ehci, int operational)
+{
+       u32 hc_control;
+
+       hc_control = (readl_be(ehci->ohci_hcctrl_reg) & ~OHCI_CTRL_HCFS);
+       if (operational)
+               hc_control |= OHCI_USB_OPER;
+       else
+               hc_control |= OHCI_USB_SUSPEND;
+
+       writel_be(hc_control, ehci->ohci_hcctrl_reg);
+       (void) readl_be(ehci->ohci_hcctrl_reg);
+}
+#else
+static inline void set_ohci_hcfs(struct ehci_hcd *ehci, int operational)
+{ }
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 /*