diff options
author | John Youn <John.Youn@synopsys.com> | 2015-12-17 14:16:45 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-12-22 12:57:55 -0500 |
commit | 1696d5ab99ef885ae62da5ad58f9eff16da7ff78 (patch) | |
tree | eb2f783b8f826e82c5c67f3566eb67b1e9eaf4e6 | |
parent | 5268ed9d2e3b52f703f3661eef14cecbb2b572d4 (diff) |
usb: dwc2: Move mode querying functions into core.h
These functions should go in core.h where they can be called from core,
device, or host.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc2/core.h | 12 | ||||
-rw-r--r-- | drivers/usb/dwc2/hcd.h | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 1fd434510a43..263a9da9edb2 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h | |||
@@ -1151,6 +1151,18 @@ bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg); | |||
1151 | bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg); | 1151 | bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg); |
1152 | 1152 | ||
1153 | /* | 1153 | /* |
1154 | * Returns the mode of operation, host or device | ||
1155 | */ | ||
1156 | static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) | ||
1157 | { | ||
1158 | return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0; | ||
1159 | } | ||
1160 | static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) | ||
1161 | { | ||
1162 | return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0; | ||
1163 | } | ||
1164 | |||
1165 | /* | ||
1154 | * Dump core registers and SPRAM | 1166 | * Dump core registers and SPRAM |
1155 | */ | 1167 | */ |
1156 | extern void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg); | 1168 | extern void dwc2_dump_dev_registers(struct dwc2_hsotg *hsotg); |
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h index 6e822661a69e..8f0a29cefdf7 100644 --- a/drivers/usb/dwc2/hcd.h +++ b/drivers/usb/dwc2/hcd.h | |||
@@ -384,18 +384,6 @@ static inline void disable_hc_int(struct dwc2_hsotg *hsotg, int chnum, u32 intr) | |||
384 | } | 384 | } |
385 | 385 | ||
386 | /* | 386 | /* |
387 | * Returns the mode of operation, host or device | ||
388 | */ | ||
389 | static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg) | ||
390 | { | ||
391 | return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0; | ||
392 | } | ||
393 | static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg) | ||
394 | { | ||
395 | return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0; | ||
396 | } | ||
397 | |||
398 | /* | ||
399 | * Reads HPRT0 in preparation to modify. It keeps the WC bits 0 so that if they | 387 | * Reads HPRT0 in preparation to modify. It keeps the WC bits 0 so that if they |
400 | * are read as 1, they won't clear when written back. | 388 | * are read as 1, they won't clear when written back. |
401 | */ | 389 | */ |