Lines Matching refs:dwc

205 static int dwc3_pci_quirks(struct dwc3_pci *dwc,  in dwc3_pci_quirks()  argument
208 struct pci_dev *pdev = dwc->pci; in dwc3_pci_quirks()
214 guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid); in dwc3_pci_quirks()
215 dwc->has_dsm_for_pm = true; in dwc3_pci_quirks()
266 dwc->dwc3->id = PLATFORM_DEVID_NONE; in dwc3_pci_quirks()
283 return device_add_software_node(&dwc->dwc3->dev, swnode); in dwc3_pci_quirks()
289 struct dwc3_pci *dwc = container_of(work, struct dwc3_pci, wakeup_work); in dwc3_pci_resume_work() local
290 struct platform_device *dwc3 = dwc->dwc3; in dwc3_pci_resume_work()
306 struct dwc3_pci *dwc; in dwc3_pci_probe() local
319 dwc = devm_kzalloc(dev, sizeof(*dwc), GFP_KERNEL); in dwc3_pci_probe()
320 if (!dwc) in dwc3_pci_probe()
323 dwc->dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); in dwc3_pci_probe()
324 if (!dwc->dwc3) in dwc3_pci_probe()
338 ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); in dwc3_pci_probe()
344 dwc->pci = pci; in dwc3_pci_probe()
345 dwc->dwc3->dev.parent = dev; in dwc3_pci_probe()
346 ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev)); in dwc3_pci_probe()
348 ret = dwc3_pci_quirks(dwc, (void *)id->driver_data); in dwc3_pci_probe()
352 ret = platform_device_add(dwc->dwc3); in dwc3_pci_probe()
359 pci_set_drvdata(pci, dwc); in dwc3_pci_probe()
362 INIT_WORK(&dwc->wakeup_work, dwc3_pci_resume_work); in dwc3_pci_probe()
367 device_remove_software_node(&dwc->dwc3->dev); in dwc3_pci_probe()
368 platform_device_put(dwc->dwc3); in dwc3_pci_probe()
374 struct dwc3_pci *dwc = pci_get_drvdata(pci); in dwc3_pci_remove() local
375 struct pci_dev *pdev = dwc->pci; in dwc3_pci_remove()
380 cancel_work_sync(&dwc->wakeup_work); in dwc3_pci_remove()
384 device_remove_software_node(&dwc->dwc3->dev); in dwc3_pci_remove()
385 platform_device_unregister(dwc->dwc3); in dwc3_pci_remove()
490 static int dwc3_pci_dsm(struct dwc3_pci *dwc, int param) in dwc3_pci_dsm() argument
496 if (!dwc->has_dsm_for_pm) in dwc3_pci_dsm()
502 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), &dwc->guid, in dwc3_pci_dsm()
505 dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n"); in dwc3_pci_dsm()
518 struct dwc3_pci *dwc = dev_get_drvdata(dev); in dwc3_pci_runtime_suspend() local
521 return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D3); in dwc3_pci_runtime_suspend()
528 struct dwc3_pci *dwc = dev_get_drvdata(dev); in dwc3_pci_runtime_resume() local
531 ret = dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D0); in dwc3_pci_runtime_resume()
535 queue_work(pm_wq, &dwc->wakeup_work); in dwc3_pci_runtime_resume()
544 struct dwc3_pci *dwc = dev_get_drvdata(dev); in dwc3_pci_suspend() local
546 return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D3); in dwc3_pci_suspend()
551 struct dwc3_pci *dwc = dev_get_drvdata(dev); in dwc3_pci_resume() local
553 return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D0); in dwc3_pci_resume()