3140058689dc50d8176133326222d81be7fc4040
[openwrt/staging/thess.git] /
1 From b5c498026a95f9d80be23711dd6c178cc78d6c33 Mon Sep 17 00:00:00 2001
2 From: Peter Chen <peter.chen@nxp.com>
3 Date: Wed, 15 Aug 2018 14:59:55 +0800
4 Subject: [PATCH] MLK-18794-1 usb: host: xhci: add .bus_suspend override
5
6 Some platforms (eg: Cadence USB3) have special requirements to add
7 platform USB register setting between xhci_bus_suspend and
8 platform USB controller suspend routine. Eg, The Cadence USB3 needs
9 RX detect clock switch from 24Mhz to 32Khz within 100ms after set
10 port to U3, but sometimes, for USB3 HUB connection, the USB2
11 bus suspend will cost more than 100ms, and introduce the disconnection
12 before the PHY enters low power mode, then the state is in mess from
13 controller side.
14
15 So in this commit, we introduce .bus_suspend for xhci_driver_overrides
16 for above use cases.
17
18 Signed-off-by: Peter Chen <peter.chen@nxp.com>
19 (cherry picked from commit f6baa57913ceb40da14a945820cb87e8d6ceb7c7)
20 ---
21 drivers/usb/host/xhci.c | 2 ++
22 drivers/usb/host/xhci.h | 1 +
23 2 files changed, 3 insertions(+)
24
25 --- a/drivers/usb/host/xhci.c
26 +++ b/drivers/usb/host/xhci.c
27 @@ -5379,6 +5379,8 @@ void xhci_init_driver(struct hc_driver *
28 drv->reset = over->reset;
29 if (over->start)
30 drv->start = over->start;
31 + if (over->bus_suspend)
32 + drv->bus_suspend = over->bus_suspend;
33 }
34 }
35 EXPORT_SYMBOL_GPL(xhci_init_driver);
36 --- a/drivers/usb/host/xhci.h
37 +++ b/drivers/usb/host/xhci.h
38 @@ -1911,6 +1911,7 @@ struct xhci_driver_overrides {
39 size_t extra_priv_size;
40 int (*reset)(struct usb_hcd *hcd);
41 int (*start)(struct usb_hcd *hcd);
42 + int (*bus_suspend)(struct usb_hcd *hcd);
43 };
44
45 #define XHCI_CFC_DELAY 10