usb: dwc2: Move mode querying functions into core.h
authorJohn Youn <John.Youn@synopsys.com>
Thu, 17 Dec 2015 19:16:45 +0000 (11:16 -0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 22 Dec 2015 17:57:55 +0000 (11:57 -0600)
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>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/hcd.h

index 1fd434510a43b672e1987faac0abf58622336806..263a9da9edb20ae72b6157fb85e06d7d502931b3 100644 (file)
@@ -1150,6 +1150,18 @@ bool dwc2_hw_is_otg(struct dwc2_hsotg *hsotg);
 bool dwc2_hw_is_host(struct dwc2_hsotg *hsotg);
 bool dwc2_hw_is_device(struct dwc2_hsotg *hsotg);
 
+/*
+ * Returns the mode of operation, host or device
+ */
+static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg)
+{
+       return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0;
+}
+static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg)
+{
+       return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0;
+}
+
 /*
  * Dump core registers and SPRAM
  */
index 6e822661a69e3263307ce96d440e59ff6c8fc6d5..8f0a29cefdf787a7a1a9c75a7cadb119a6f32872 100644 (file)
@@ -383,18 +383,6 @@ static inline void disable_hc_int(struct dwc2_hsotg *hsotg, int chnum, u32 intr)
        dwc2_writel(mask, hsotg->regs + HCINTMSK(chnum));
 }
 
-/*
- * Returns the mode of operation, host or device
- */
-static inline int dwc2_is_host_mode(struct dwc2_hsotg *hsotg)
-{
-       return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) != 0;
-}
-static inline int dwc2_is_device_mode(struct dwc2_hsotg *hsotg)
-{
-       return (dwc2_readl(hsotg->regs + GINTSTS) & GINTSTS_CURMODE_HOST) == 0;
-}
-
 /*
  * Reads HPRT0 in preparation to modify. It keeps the WC bits 0 so that if they
  * are read as 1, they won't clear when written back.
This page took 0.042054 seconds and 5 git commands to generate.