]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: dwc3: Add a check for the DWC_usb3 core
authorJohn Youn <johnyoun@synopsys.com>
Fri, 11 Nov 2016 01:08:48 +0000 (17:08 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:20 +0000 (13:54 +0200)
Add a helper function to check if we are running on a DWC_usb3 core.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.h

index b9903c6c3de48bbd5b9035efe00f1f4fc5340ffc..354de247356a15ffcf07511b0eac78a78413293d 100644 (file)
@@ -1148,6 +1148,12 @@ struct dwc3_gadget_ep_cmd_params {
 void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
 u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type);
 
+/* check whether we are on the DWC_usb3 core */
+static inline bool dwc3_is_usb3(struct dwc3 *dwc)
+{
+       return !(dwc->revision & DWC3_REVISION_IS_DWC31);
+}
+
 /* check whether we are on the DWC_usb31 core */
 static inline bool dwc3_is_usb31(struct dwc3 *dwc)
 {