Lines Matching refs:uhci
85 #define UHCI_PTR_BITS(uhci) cpu_to_hc32((uhci), 0x000F) argument
86 #define UHCI_PTR_TERM(uhci) cpu_to_hc32((uhci), 0x0001) argument
87 #define UHCI_PTR_QH(uhci) cpu_to_hc32((uhci), 0x0002) argument
88 #define UHCI_PTR_DEPTH(uhci) cpu_to_hc32((uhci), 0x0004) argument
89 #define UHCI_PTR_BREADTH(uhci) cpu_to_hc32((uhci), 0x0000) argument
193 #define LINK_TO_QH(uhci, qh) (UHCI_PTR_QH((uhci)) | \ argument
194 cpu_to_hc32((uhci), (qh)->dma_handle))
227 #define td_token(uhci, td) hc32_to_cpu((uhci), (td)->token) argument
278 #define td_status(uhci, td) hc32_to_cpu((uhci), \ argument
281 #define LINK_TO_TD(uhci, td) (cpu_to_hc32((uhci), (td)->dma_handle)) argument
450 void (*reset_hc) (struct uhci_hcd *uhci);
451 int (*check_and_reset_hc) (struct uhci_hcd *uhci);
453 void (*configure_hc) (struct uhci_hcd *uhci);
455 int (*resume_detect_interrupts_are_broken) (struct uhci_hcd *uhci);
457 int (*global_suspend_mode_is_broken) (struct uhci_hcd *uhci);
465 static inline struct usb_hcd *uhci_to_hcd(struct uhci_hcd *uhci) in uhci_to_hcd() argument
467 return container_of((void *) uhci, struct usb_hcd, hcd_priv); in uhci_to_hcd()
497 static inline bool uhci_is_aspeed(const struct uhci_hcd *uhci) in uhci_is_aspeed() argument
499 return IS_ENABLED(CONFIG_USB_UHCI_ASPEED) && uhci->is_aspeed; in uhci_is_aspeed()
518 static inline u32 uhci_readl(const struct uhci_hcd *uhci, int reg) in uhci_readl() argument
520 return inl(uhci->io_addr + reg); in uhci_readl()
523 static inline void uhci_writel(const struct uhci_hcd *uhci, u32 val, int reg) in uhci_writel() argument
525 outl(val, uhci->io_addr + reg); in uhci_writel()
528 static inline u16 uhci_readw(const struct uhci_hcd *uhci, int reg) in uhci_readw() argument
530 return inw(uhci->io_addr + reg); in uhci_readw()
533 static inline void uhci_writew(const struct uhci_hcd *uhci, u16 val, int reg) in uhci_writew() argument
535 outw(val, uhci->io_addr + reg); in uhci_writew()
538 static inline u8 uhci_readb(const struct uhci_hcd *uhci, int reg) in uhci_readb() argument
540 return inb(uhci->io_addr + reg); in uhci_readb()
543 static inline void uhci_writeb(const struct uhci_hcd *uhci, u8 val, int reg) in uhci_writeb() argument
545 outb(val, uhci->io_addr + reg); in uhci_writeb()
595 static inline u32 uhci_readl(const struct uhci_hcd *uhci, int reg) in uhci_readl() argument
597 if (uhci_has_pci_registers(uhci)) in uhci_readl()
598 return UHCI_IN(inl(uhci->io_addr + reg)); in uhci_readl()
599 else if (uhci_is_aspeed(uhci)) in uhci_readl()
600 return readl(uhci->regs + uhci_aspeed_reg(reg)); in uhci_readl()
602 else if (uhci_big_endian_mmio(uhci)) in uhci_readl()
603 return readl_be(uhci->regs + reg); in uhci_readl()
606 return readl(uhci->regs + reg); in uhci_readl()
609 static inline void uhci_writel(const struct uhci_hcd *uhci, u32 val, int reg) in uhci_writel() argument
611 if (uhci_has_pci_registers(uhci)) in uhci_writel()
612 UHCI_OUT(outl(val, uhci->io_addr + reg)); in uhci_writel()
613 else if (uhci_is_aspeed(uhci)) in uhci_writel()
614 writel(val, uhci->regs + uhci_aspeed_reg(reg)); in uhci_writel()
616 else if (uhci_big_endian_mmio(uhci)) in uhci_writel()
617 writel_be(val, uhci->regs + reg); in uhci_writel()
620 writel(val, uhci->regs + reg); in uhci_writel()
623 static inline u16 uhci_readw(const struct uhci_hcd *uhci, int reg) in uhci_readw() argument
625 if (uhci_has_pci_registers(uhci)) in uhci_readw()
626 return UHCI_IN(inw(uhci->io_addr + reg)); in uhci_readw()
627 else if (uhci_is_aspeed(uhci)) in uhci_readw()
628 return readl(uhci->regs + uhci_aspeed_reg(reg)); in uhci_readw()
630 else if (uhci_big_endian_mmio(uhci)) in uhci_readw()
631 return readw_be(uhci->regs + reg); in uhci_readw()
634 return readw(uhci->regs + reg); in uhci_readw()
637 static inline void uhci_writew(const struct uhci_hcd *uhci, u16 val, int reg) in uhci_writew() argument
639 if (uhci_has_pci_registers(uhci)) in uhci_writew()
640 UHCI_OUT(outw(val, uhci->io_addr + reg)); in uhci_writew()
641 else if (uhci_is_aspeed(uhci)) in uhci_writew()
642 writel(val, uhci->regs + uhci_aspeed_reg(reg)); in uhci_writew()
644 else if (uhci_big_endian_mmio(uhci)) in uhci_writew()
645 writew_be(val, uhci->regs + reg); in uhci_writew()
648 writew(val, uhci->regs + reg); in uhci_writew()
651 static inline u8 uhci_readb(const struct uhci_hcd *uhci, int reg) in uhci_readb() argument
653 if (uhci_has_pci_registers(uhci)) in uhci_readb()
654 return UHCI_IN(inb(uhci->io_addr + reg)); in uhci_readb()
655 else if (uhci_is_aspeed(uhci)) in uhci_readb()
656 return readl(uhci->regs + uhci_aspeed_reg(reg)); in uhci_readb()
658 else if (uhci_big_endian_mmio(uhci)) in uhci_readb()
659 return readb_be(uhci->regs + reg); in uhci_readb()
662 return readb(uhci->regs + reg); in uhci_readb()
665 static inline void uhci_writeb(const struct uhci_hcd *uhci, u8 val, int reg) in uhci_writeb() argument
667 if (uhci_has_pci_registers(uhci)) in uhci_writeb()
668 UHCI_OUT(outb(val, uhci->io_addr + reg)); in uhci_writeb()
669 else if (uhci_is_aspeed(uhci)) in uhci_writeb()
670 writel(val, uhci->regs + uhci_aspeed_reg(reg)); in uhci_writeb()
672 else if (uhci_big_endian_mmio(uhci)) in uhci_writeb()
673 writeb_be(val, uhci->regs + reg); in uhci_writeb()
676 writeb(val, uhci->regs + reg); in uhci_writeb()
692 static inline __hc32 cpu_to_hc32(const struct uhci_hcd *uhci, const u32 x) in cpu_to_hc32() argument
694 return uhci_big_endian_desc(uhci) in cpu_to_hc32()
700 static inline u32 hc32_to_cpu(const struct uhci_hcd *uhci, const __hc32 x) in hc32_to_cpu() argument
702 return uhci_big_endian_desc(uhci) in hc32_to_cpu()
709 static inline __hc32 cpu_to_hc32(const struct uhci_hcd *uhci, const u32 x) in cpu_to_hc32() argument
715 static inline u32 hc32_to_cpu(const struct uhci_hcd *uhci, const __hc32 x) in hc32_to_cpu() argument