aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r--drivers/usb/host/ehci.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 74dbc6c8228f..5f28b74bb8d3 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -92,6 +92,7 @@ struct ehci_hcd { /* one per controller */
92 unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */ 92 unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */
93 unsigned no_selective_suspend:1; 93 unsigned no_selective_suspend:1;
94 unsigned has_fsl_port_bug:1; /* FreeScale */ 94 unsigned has_fsl_port_bug:1; /* FreeScale */
95 unsigned big_endian_mmio:1;
95 96
96 u8 sbrn; /* packed release number */ 97 u8 sbrn; /* packed release number */
97 98
@@ -651,6 +652,37 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
651#define ehci_has_fsl_portno_bug(e) (0) 652#define ehci_has_fsl_portno_bug(e) (0)
652#endif 653#endif
653 654
655/*
656 * While most USB host controllers implement their registers in
657 * little-endian format, a minority (celleb companion chip) implement
658 * them in big endian format.
659 *
660 * This attempts to support either format at compile time without a
661 * runtime penalty, or both formats with the additional overhead
662 * of checking a flag bit.
663 */
664
665#ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
666#define ehci_big_endian_mmio(e) ((e)->big_endian_mmio)
667#else
668#define ehci_big_endian_mmio(e) 0
669#endif
670
671static inline unsigned int ehci_readl (const struct ehci_hcd *ehci,
672 __u32 __iomem * regs)
673{
674 return ehci_big_endian_mmio(ehci) ?
675 readl_be((__force u32 *)regs) :
676 readl((__force u32 *)regs);
677}
678
679static inline void ehci_writel (const struct ehci_hcd *ehci,
680 const unsigned int val, __u32 __iomem *regs)
681{
682 ehci_big_endian_mmio(ehci) ?
683 writel_be(val, (__force u32 *)regs) :
684 writel(val, (__force u32 *)regs);
685}
654 686
655/*-------------------------------------------------------------------------*/ 687/*-------------------------------------------------------------------------*/
656 688