aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3/io.h')
-rw-r--r--drivers/usb/dwc3/io.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h
index 071d561f3e6..a50f76b9d19 100644
--- a/drivers/usb/dwc3/io.h
+++ b/drivers/usb/dwc3/io.h
@@ -41,14 +41,26 @@
41 41
42#include <linux/io.h> 42#include <linux/io.h>
43 43
44#include "core.h"
45
44static inline u32 dwc3_readl(void __iomem *base, u32 offset) 46static inline u32 dwc3_readl(void __iomem *base, u32 offset)
45{ 47{
46 return readl(base + offset); 48 /*
49 * We requested the mem region starting from the Globals address
50 * space, see dwc3_probe in core.c.
51 * However, the offsets are given starting from xHCI address space.
52 */
53 return readl(base + (offset - DWC3_GLOBALS_REGS_START));
47} 54}
48 55
49static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value) 56static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
50{ 57{
51 writel(value, base + offset); 58 /*
59 * We requested the mem region starting from the Globals address
60 * space, see dwc3_probe in core.c.
61 * However, the offsets are given starting from xHCI address space.
62 */
63 writel(value, base + (offset - DWC3_GLOBALS_REGS_START));
52} 64}
53 65
54#endif /* __DRIVERS_USB_DWC3_IO_H */ 66#endif /* __DRIVERS_USB_DWC3_IO_H */