Lines Matching +full:usb2 +full:- +full:lpm +full:- +full:disable

1 // SPDX-License-Identifier: GPL-2.0
3 * host.c - DesignWare USB3 DRD Controller Host Glue
5 * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com
16 #include "../host/xhci-port.h"
17 #include "../host/xhci-ext-caps.h"
18 #include "../host/xhci-caps.h"
19 #include "../host/xhci-plat.h"
26 * dwc3_power_off_all_roothub_ports - Power off all Root hub ports
39 if (dwc->xhci_resources[0].start) { in dwc3_power_off_all_roothub_ports()
40 xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END); in dwc3_power_off_all_roothub_ports()
42 dev_err(dwc->dev, "Failed to ioremap xhci_regs\n"); in dwc3_power_off_all_roothub_ports()
51 offset = op_regs_base + XHCI_PORTSC_BASE + 0x10 * (i - 1); in dwc3_power_off_all_roothub_ports()
59 dev_err(dwc->dev, "xhci base reg invalid\n"); in dwc3_power_off_all_roothub_ports()
71 pdev = to_platform_device(hcd->self.controller); in dwc3_xhci_plat_start()
72 dwc = dev_get_drvdata(pdev->dev.parent); in dwc3_xhci_plat_start()
84 struct platform_device *pdev = to_platform_device(dwc->dev); in dwc3_host_fill_xhci_irq_res()
85 struct device_node *np = dev_of_node(&pdev->dev); in dwc3_host_fill_xhci_irq_res()
87 dwc->xhci_resources[1].start = irq; in dwc3_host_fill_xhci_irq_res()
88 dwc->xhci_resources[1].end = irq; in dwc3_host_fill_xhci_irq_res()
89 dwc->xhci_resources[1].flags = IORESOURCE_IRQ | irq_get_trigger_type(irq); in dwc3_host_fill_xhci_irq_res()
91 dwc->xhci_resources[1].name = of_node_full_name(pdev->dev.of_node); in dwc3_host_fill_xhci_irq_res()
93 dwc->xhci_resources[1].name = name; in dwc3_host_fill_xhci_irq_res()
98 struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); in dwc3_host_get_irq()
107 if (irq == -EPROBE_DEFER) in dwc3_host_get_irq()
116 if (irq == -EPROBE_DEFER) in dwc3_host_get_irq()
144 xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); in dwc3_host_init()
146 dev_err(dwc->dev, "couldn't allocate xHCI device\n"); in dwc3_host_init()
147 return -ENOMEM; in dwc3_host_init()
150 xhci->dev.parent = dwc->dev; in dwc3_host_init()
152 dwc->xhci = xhci; in dwc3_host_init()
154 ret = platform_device_add_resources(xhci, dwc->xhci_resources, in dwc3_host_init()
157 dev_err(dwc->dev, "couldn't add resources to xHCI device\n"); in dwc3_host_init()
163 props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); in dwc3_host_init()
165 props[prop_idx++] = PROPERTY_ENTRY_BOOL("write-64-hi-lo-quirk"); in dwc3_host_init()
167 if (dwc->usb3_lpm_capable) in dwc3_host_init()
168 props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); in dwc3_host_init()
170 if (dwc->usb2_lpm_disable) in dwc3_host_init()
171 props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable"); in dwc3_host_init()
175 * where Port Disable command doesn't work. in dwc3_host_init()
177 * The suggested workaround is that we avoid Port Disable in dwc3_host_init()
183 props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped"); in dwc3_host_init()
186 ret = device_create_managed_software_node(&xhci->dev, props, NULL); in dwc3_host_init()
188 dev_err(dwc->dev, "failed to add properties to xHCI\n"); in dwc3_host_init()
200 dev_err(dwc->dev, "failed to register xHCI device\n"); in dwc3_host_init()
204 if (dwc->sys_wakeup) { in dwc3_host_init()
206 device_wakeup_enable(dwc->sysdev); in dwc3_host_init()
209 device_init_wakeup(&xhci->dev, true); in dwc3_host_init()
220 if (dwc->sys_wakeup) in dwc3_host_exit()
221 device_init_wakeup(&dwc->xhci->dev, false); in dwc3_host_exit()
224 platform_device_unregister(dwc->xhci); in dwc3_host_exit()
225 dwc->xhci = NULL; in dwc3_host_exit()