diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-04-12 16:53:39 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-06-20 12:32:35 +0300 |
commit | 2eb8801650b315394ca376a56be2971c867aa9ec (patch) | |
tree | 1bd8d01f8d43149e84846c762eedc870b91e9978 /drivers/usb/dwc3/io.h | |
parent | 2cd4718d0bbe1906fcf517f0b254fbd7c072383a (diff) | |
download | linux-2eb8801650b315394ca376a56be2971c867aa9ec.tar.gz |
usb: dwc3: gadget: add a pointer to endpoint registers
By adding a pointer to endpoint registers' base
address, we can avoid using our controller-wide
struct dwc3 pointer for everything. At some point
this will allow us to have per-endpoint locks which
will, in turn, let us queue requests to separate
endpoints in parallel.
Because of this change our debugfs interface and io
accessors need to be changed accordingly.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/io.h')
-rw-r--r-- | drivers/usb/dwc3/io.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h index 6a79c8e66bbc..a06f9a8fecc7 100644 --- a/drivers/usb/dwc3/io.h +++ b/drivers/usb/dwc3/io.h @@ -26,7 +26,6 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset) { - u32 offs = offset - DWC3_GLOBALS_REGS_START; u32 value; /* @@ -34,7 +33,7 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset) * space, see dwc3_probe in core.c. * However, the offsets are given starting from xHCI address space. */ - value = readl(base + offs); + value = readl(base + offset - DWC3_GLOBALS_REGS_START); /* * When tracing we want to make it easy to find the correct address on @@ -49,14 +48,12 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset) static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value) { - u32 offs = offset - DWC3_GLOBALS_REGS_START; - /* * We requested the mem region starting from the Globals address * space, see dwc3_probe in core.c. * However, the offsets are given starting from xHCI address space. */ - writel(value, base + offs); + writel(value, base + offset - DWC3_GLOBALS_REGS_START); /* * When tracing we want to make it easy to find the correct address on |