|
24 | 24 | #define CFG_RXDET_P3_EN BIT(15)
|
25 | 25 | #define LPM_2_STB_SWITCH_EN BIT(25)
|
26 | 26 |
|
27 |
| -static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); |
| 27 | +static void xhci_cdns3_plat_start(struct usb_hcd *hcd) |
| 28 | +{ |
| 29 | + struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
| 30 | + u32 value; |
| 31 | + |
| 32 | + /* set usbcmd.EU3S */ |
| 33 | + value = readl(&xhci->op_regs->command); |
| 34 | + value |= CMD_PM_INDEX; |
| 35 | + writel(value, &xhci->op_regs->command); |
| 36 | + |
| 37 | + if (hcd->regs) { |
| 38 | + value = readl(hcd->regs + XECP_AUX_CTRL_REG1); |
| 39 | + value |= CFG_RXDET_P3_EN; |
| 40 | + writel(value, hcd->regs + XECP_AUX_CTRL_REG1); |
| 41 | + |
| 42 | + value = readl(hcd->regs + XECP_PORT_CAP_REG); |
| 43 | + value |= LPM_2_STB_SWITCH_EN; |
| 44 | + writel(value, hcd->regs + XECP_PORT_CAP_REG); |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +static int xhci_cdns3_resume_quirk(struct usb_hcd *hcd) |
| 49 | +{ |
| 50 | + xhci_cdns3_plat_start(hcd); |
| 51 | + return 0; |
| 52 | +} |
28 | 53 |
|
29 | 54 | static const struct xhci_plat_priv xhci_plat_cdns3_xhci = {
|
30 | 55 | .quirks = XHCI_SKIP_PHY_INIT | XHCI_AVOID_BEI,
|
31 |
| - .suspend_quirk = xhci_cdns3_suspend_quirk, |
| 56 | + .plat_start = xhci_cdns3_plat_start, |
| 57 | + .resume_quirk = xhci_cdns3_resume_quirk, |
32 | 58 | };
|
33 | 59 |
|
34 | 60 | static int __cdns_host_init(struct cdns *cdns)
|
@@ -90,32 +116,6 @@ static int __cdns_host_init(struct cdns *cdns)
|
90 | 116 | return ret;
|
91 | 117 | }
|
92 | 118 |
|
93 |
| -static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) |
94 |
| -{ |
95 |
| - struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
96 |
| - u32 value; |
97 |
| - |
98 |
| - if (pm_runtime_status_suspended(hcd->self.controller)) |
99 |
| - return 0; |
100 |
| - |
101 |
| - /* set usbcmd.EU3S */ |
102 |
| - value = readl(&xhci->op_regs->command); |
103 |
| - value |= CMD_PM_INDEX; |
104 |
| - writel(value, &xhci->op_regs->command); |
105 |
| - |
106 |
| - if (hcd->regs) { |
107 |
| - value = readl(hcd->regs + XECP_AUX_CTRL_REG1); |
108 |
| - value |= CFG_RXDET_P3_EN; |
109 |
| - writel(value, hcd->regs + XECP_AUX_CTRL_REG1); |
110 |
| - |
111 |
| - value = readl(hcd->regs + XECP_PORT_CAP_REG); |
112 |
| - value |= LPM_2_STB_SWITCH_EN; |
113 |
| - writel(value, hcd->regs + XECP_PORT_CAP_REG); |
114 |
| - } |
115 |
| - |
116 |
| - return 0; |
117 |
| -} |
118 |
| - |
119 | 119 | static void cdns_host_exit(struct cdns *cdns)
|
120 | 120 | {
|
121 | 121 | kfree(cdns->xhci_plat_data);
|
|
0 commit comments