aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorJohn Youn <John.Youn@synopsys.com>2016-02-05 17:08:18 -0800
committerFelipe Balbi <balbi@kernel.org>2016-03-04 15:14:26 +0200
commitc4137a9c841ec7fb300782d211f2d6907f4d6e20 (patch)
tree7978df9da2ab879aed2d64f0bcbf503532254849 /drivers/usb/dwc3
parentusb: gadget: f_mass_storage: Enable SuperSpeedPlus (diff)
downloadlinux-dev-c4137a9c841ec7fb300782d211f2d6907f4d6e20.tar.xz
linux-dev-c4137a9c841ec7fb300782d211f2d6907f4d6e20.zip
usb: dwc3: DWC_usb31 controller check
Add a convenience function to check if the controller is DWC_usb31. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/core.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index e4f8b90d9627..c0520d67c2c3 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -1024,6 +1024,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);