summaryrefslogtreecommitdiff
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.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h
index a06f9a8fecc7..adc8648c92b2 100644
--- a/drivers/usb/dwc3/io.h
+++ b/drivers/usb/dwc3/io.h
@@ -28,6 +28,13 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset)
{
u32 value;
+#ifdef CONFIG_USB_DWC3_HISI
+ extern atomic_t hisi_dwc3_power_on;
+
+ if (unlikely(atomic_read(&hisi_dwc3_power_on) == 0))
+ return 0;
+#endif
+
/*
* We requested the mem region starting from the Globals address
* space, see dwc3_probe in core.c.
@@ -40,14 +47,20 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset)
* documentation, so we revert it back to the proper addresses, the
* same way they are described on SNPS documentation
*/
- dwc3_trace(trace_dwc3_readl, "addr %p value %08x",
- base - DWC3_GLOBALS_REGS_START + offset, value);
+ trace_dwc3_readl(base - DWC3_GLOBALS_REGS_START, offset, value);
return value;
}
static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
{
+#ifdef CONFIG_USB_DWC3_HISI
+ extern atomic_t hisi_dwc3_power_on;
+
+ if (unlikely(atomic_read(&hisi_dwc3_power_on) == 0))
+ return;
+#endif
+
/*
* We requested the mem region starting from the Globals address
* space, see dwc3_probe in core.c.
@@ -60,8 +73,7 @@ static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
* documentation, so we revert it back to the proper addresses, the
* same way they are described on SNPS documentation
*/
- dwc3_trace(trace_dwc3_writel, "addr %p value %08x",
- base - DWC3_GLOBALS_REGS_START + offset, value);
+ trace_dwc3_writel(base - DWC3_GLOBALS_REGS_START, offset, value);
}
#endif /* __DRIVERS_USB_DWC3_IO_H */