Re: [PATCH 12/18] usb: dwc2: Move mode querying functions into core.h

2015-12-09 Thread Doug Anderson
John,

On Wed, Dec 2, 2015 at 11:14 AM, John Youn  wrote:
> These functions should go in core.h where they can be called from core,
> device, or host.
>
> Signed-off-by: John Youn 
> ---
>  drivers/usb/dwc2/core.h | 12 
>  drivers/usb/dwc2/hcd.h  | 12 
>  2 files changed, 12 insertions(+), 12 deletions(-)

Yup.  Fine, fine.

Works across many reboots on a farm of rk3288-based devices on a 3.14 kernel.

Reviewed-by: Douglas Anderson 
Tested-by: Douglas Anderson 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/18] usb: dwc2: Move mode querying functions into core.h

2015-12-02 Thread John Youn
These functions should go in core.h where they can be called from core,
device, or host.

Signed-off-by: John Youn 
---
 drivers/usb/dwc2/core.h | 12 
 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 2768f0c..8f2a9ff 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -1160,6 +1160,18 @@ 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
  */
 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 d893442..344b6f0 100644
--- a/drivers/usb/dwc2/hcd.h
+++ b/drivers/usb/dwc2/hcd.h
@@ -374,18 +374,6 @@ static inline void disable_hc_int(struct dwc2_hsotg 
*hsotg, int chnum, u32 intr)
 }
 
 /*
- * 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.
  */
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html