47278d40c5db192527c692f559f5f3d6447f6f89
[openwrt/staging/yousong.git] / target / linux / ipq806x / patches-4.4 / 096-04-usb-dwc3-DWC_usb31-controller-check.patch
1 From c4137a9c841ec7fb300782d211f2d6907f4d6e20 Mon Sep 17 00:00:00 2001
2 From: John Youn <John.Youn@synopsys.com>
3 Date: Fri, 5 Feb 2016 17:08:18 -0800
4 Subject: usb: dwc3: DWC_usb31 controller check
5
6 Add a convenience function to check if the controller is DWC_usb31.
7
8 Signed-off-by: John Youn <johnyoun@synopsys.com>
9 Signed-off-by: Felipe Balbi <balbi@kernel.org>
10 ---
11 drivers/usb/dwc3/core.h | 6 ++++++
12 1 file changed, 6 insertions(+)
13
14 diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
15 index e4f8b90..c0520d67 100644
16 --- a/drivers/usb/dwc3/core.h
17 +++ b/drivers/usb/dwc3/core.h
18 @@ -1024,6 +1024,12 @@ struct dwc3_gadget_ep_cmd_params {
19 void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
20 int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);
21
22 +/* check whether we are on the DWC_usb31 core */
23 +static inline bool dwc3_is_usb31(struct dwc3 *dwc)
24 +{
25 + return !!(dwc->revision & DWC3_REVISION_IS_DWC31);
26 +}
27 +
28 #if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
29 int dwc3_host_init(struct dwc3 *dwc);
30 void dwc3_host_exit(struct dwc3 *dwc);
31 --
32 cgit v0.12