diff options
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r-- | drivers/usb/host/ehci.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 74dbc6c8228f..46fa57a520d0 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -74,7 +74,11 @@ struct ehci_hcd { /* one per controller */ | |||
74 | 74 | ||
75 | /* per root hub port */ | 75 | /* per root hub port */ |
76 | unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; | 76 | unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; |
77 | unsigned long bus_suspended; | 77 | /* bit vectors (one bit per port) */ |
78 | unsigned long bus_suspended; /* which ports were | ||
79 | already suspended at the start of a bus suspend */ | ||
80 | unsigned long companion_ports; /* which ports are | ||
81 | dedicated to the companion controller */ | ||
78 | 82 | ||
79 | /* per-HC memory pools (could be per-bus, but ...) */ | 83 | /* per-HC memory pools (could be per-bus, but ...) */ |
80 | struct dma_pool *qh_pool; /* qh per active urb */ | 84 | struct dma_pool *qh_pool; /* qh per active urb */ |
@@ -92,6 +96,7 @@ struct ehci_hcd { /* one per controller */ | |||
92 | unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */ | 96 | unsigned is_tdi_rh_tt:1; /* TDI roothub with TT */ |
93 | unsigned no_selective_suspend:1; | 97 | unsigned no_selective_suspend:1; |
94 | unsigned has_fsl_port_bug:1; /* FreeScale */ | 98 | unsigned has_fsl_port_bug:1; /* FreeScale */ |
99 | unsigned big_endian_mmio:1; | ||
95 | 100 | ||
96 | u8 sbrn; /* packed release number */ | 101 | u8 sbrn; /* packed release number */ |
97 | 102 | ||
@@ -651,6 +656,45 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) | |||
651 | #define ehci_has_fsl_portno_bug(e) (0) | 656 | #define ehci_has_fsl_portno_bug(e) (0) |
652 | #endif | 657 | #endif |
653 | 658 | ||
659 | /* | ||
660 | * While most USB host controllers implement their registers in | ||
661 | * little-endian format, a minority (celleb companion chip) implement | ||
662 | * them in big endian format. | ||
663 | * | ||
664 | * This attempts to support either format at compile time without a | ||
665 | * runtime penalty, or both formats with the additional overhead | ||
666 | * of checking a flag bit. | ||
667 | */ | ||
668 | |||
669 | #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO | ||
670 | #define ehci_big_endian_mmio(e) ((e)->big_endian_mmio) | ||
671 | #else | ||
672 | #define ehci_big_endian_mmio(e) 0 | ||
673 | #endif | ||
674 | |||
675 | static inline unsigned int ehci_readl (const struct ehci_hcd *ehci, | ||
676 | __u32 __iomem * regs) | ||
677 | { | ||
678 | #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO | ||
679 | return ehci_big_endian_mmio(ehci) ? | ||
680 | readl_be(regs) : | ||
681 | readl(regs); | ||
682 | #else | ||
683 | return readl(regs); | ||
684 | #endif | ||
685 | } | ||
686 | |||
687 | static inline void ehci_writel (const struct ehci_hcd *ehci, | ||
688 | const unsigned int val, __u32 __iomem *regs) | ||
689 | { | ||
690 | #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO | ||
691 | ehci_big_endian_mmio(ehci) ? | ||
692 | writel_be(val, regs) : | ||
693 | writel(val, regs); | ||
694 | #else | ||
695 | writel(val, regs); | ||
696 | #endif | ||
697 | } | ||
654 | 698 | ||
655 | /*-------------------------------------------------------------------------*/ | 699 | /*-------------------------------------------------------------------------*/ |
656 | 700 | ||