Lines Matching refs:dwc

29 static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)  in dwc3_power_off_all_roothub_ports()  argument
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()
59 dev_err(dwc->dev, "xhci base reg invalid\n"); in dwc3_power_off_all_roothub_ports()
66 struct dwc3 *dwc; in dwc3_xhci_plat_start() local
72 dwc = dev_get_drvdata(pdev->dev.parent); in dwc3_xhci_plat_start()
74 dwc3_enable_susphy(dwc, true); in dwc3_xhci_plat_start()
81 static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc, in dwc3_host_fill_xhci_irq_res() argument
84 struct platform_device *pdev = to_platform_device(dwc->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()
96 static int dwc3_host_get_irq(struct dwc3 *dwc) in dwc3_host_get_irq() argument
98 struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); in dwc3_host_get_irq()
103 dwc3_host_fill_xhci_irq_res(dwc, irq, "host"); in dwc3_host_get_irq()
112 dwc3_host_fill_xhci_irq_res(dwc, irq, "dwc_usb3"); in dwc3_host_get_irq()
121 dwc3_host_fill_xhci_irq_res(dwc, irq, NULL); in dwc3_host_get_irq()
127 int dwc3_host_init(struct dwc3 *dwc) in dwc3_host_init() argument
138 dwc3_power_off_all_roothub_ports(dwc); in dwc3_host_init()
140 irq = dwc3_host_get_irq(dwc); in dwc3_host_init()
146 dev_err(dwc->dev, "couldn't allocate xHCI device\n"); 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()
167 if (dwc->usb3_lpm_capable) in dwc3_host_init()
170 if (dwc->usb2_lpm_disable) 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()
218 void dwc3_host_exit(struct dwc3 *dwc) in dwc3_host_exit() argument
220 if (dwc->sys_wakeup) in dwc3_host_exit()
221 device_init_wakeup(&dwc->xhci->dev, false); in dwc3_host_exit()
223 dwc3_enable_susphy(dwc, false); in dwc3_host_exit()
224 platform_device_unregister(dwc->xhci); in dwc3_host_exit()
225 dwc->xhci = NULL; in dwc3_host_exit()