From: John Youn Date: Sat, 6 Feb 2016 01:08:18 +0000 (-0800) Subject: UPSTREAM: usb: dwc3: DWC_usb31 controller check X-Git-Tag: firefly_0821_release~1885 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=46ba6580a0e55096dc054a86d1f03bf4b592a11a;p=firefly-linux-kernel-4.4.55.git UPSTREAM: usb: dwc3: DWC_usb31 controller check Add a convenience function to check if the controller is DWC_usb31. Change-Id: I2018d882b389a8499d4c88171650ac22059139be Signed-off-by: John Youn Signed-off-by: Felipe Balbi Signed-off-by: Wu Liang feng (cherry picked from commit c4137a9c841ec7fb300782d211f2d6907f4d6e20) --- diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 52fbe58dcc79..1b941ee9e5d8 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1025,6 +1025,12 @@ struct dwc3_gadget_ep_cmd_params { void dwc3_set_mode(struct dwc3 *dwc, u32 mode); int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc); +/* check whether we are on the DWC_usb31 core */ +static inline bool dwc3_is_usb31(struct dwc3 *dwc) +{ + return !!(dwc->revision & DWC3_REVISION_IS_DWC31); +} + #if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) int dwc3_host_init(struct dwc3 *dwc); void dwc3_host_exit(struct dwc3 *dwc);