Lines Matching +full:usb2 +full:- +full:lpm +full:- +full:disable
1 // SPDX-License-Identifier: GPL-2.0
3 * dwc3-pci.c - PCI Specific glue layer
5 * Copyright (C) 2010-2011 Texas Instruments Incorporated - https://www.ti.com
45 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
55 * struct dwc3_pci - Driver private structure
76 { "reset-gpios", &reset_gpios, 1 },
77 { "cs-gpios", &cs_gpios, 1 },
97 return -ENOMEM; in dwc3_byt_enable_ulpi_refclock()
120 PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"),
123 PROPERTY_ENTRY_BOOL("snps,usb2-gadget-lpm-disable"),
129 PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
130 PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
150 struct pci_dev *pdev = dwc->pci; in dwc3_pci_quirks()
152 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in dwc3_pci_quirks()
153 if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || in dwc3_pci_quirks()
154 pdev->device == PCI_DEVICE_ID_INTEL_BXT_M || in dwc3_pci_quirks()
155 pdev->device == PCI_DEVICE_ID_INTEL_EHLLP) { in dwc3_pci_quirks()
156 guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid); in dwc3_pci_quirks()
157 dwc->has_dsm_for_pm = true; in dwc3_pci_quirks()
160 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) { in dwc3_pci_quirks()
169 ret = devm_acpi_dev_add_driver_gpios(&pdev->dev, in dwc3_pci_quirks()
172 dev_dbg(&pdev->dev, "failed to add mapping table\n"); in dwc3_pci_quirks()
180 if (acpi_dev_present("INT33FC", NULL, -1)) in dwc3_pci_quirks()
184 * These GPIOs will turn on the USB2 PHY. Note that we have to in dwc3_pci_quirks()
188 gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); in dwc3_pci_quirks()
195 gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); in dwc3_pci_quirks()
214 struct platform_device *dwc3 = dwc->dwc3; in dwc3_pci_resume_work()
217 ret = pm_runtime_get_sync(&dwc3->dev); in dwc3_pci_resume_work()
219 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
223 pm_runtime_mark_last_busy(&dwc3->dev); in dwc3_pci_resume_work()
224 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
230 struct property_entry *p = (struct property_entry *)id->driver_data; in dwc3_pci_probe()
234 struct device *dev = &pci->dev; in dwc3_pci_probe()
239 return -ENODEV; in dwc3_pci_probe()
246 return -ENOMEM; in dwc3_pci_probe()
248 dwc->dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); in dwc3_pci_probe()
249 if (!dwc->dwc3) in dwc3_pci_probe()
250 return -ENOMEM; in dwc3_pci_probe()
259 res[1].start = pci->irq; in dwc3_pci_probe()
263 ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); in dwc3_pci_probe()
269 dwc->pci = pci; in dwc3_pci_probe()
270 dwc->dwc3->dev.parent = dev; in dwc3_pci_probe()
271 ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev)); in dwc3_pci_probe()
273 ret = platform_device_add_properties(dwc->dwc3, p); in dwc3_pci_probe()
281 ret = platform_device_add(dwc->dwc3); in dwc3_pci_probe()
291 INIT_WORK(&dwc->wakeup_work, dwc3_pci_resume_work); in dwc3_pci_probe()
296 platform_device_put(dwc->dwc3); in dwc3_pci_probe()
303 struct pci_dev *pdev = dwc->pci; in dwc3_pci_remove()
305 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) in dwc3_pci_remove()
308 cancel_work_sync(&dwc->wakeup_work); in dwc3_pci_remove()
310 device_init_wakeup(&pci->dev, false); in dwc3_pci_remove()
311 pm_runtime_get(&pci->dev); in dwc3_pci_remove()
312 platform_device_unregister(dwc->dwc3); in dwc3_pci_remove()
392 if (!dwc->has_dsm_for_pm) in dwc3_pci_dsm()
398 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), &dwc->guid, in dwc3_pci_dsm()
401 dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n"); in dwc3_pci_dsm()
402 return -EIO; in dwc3_pci_dsm()
419 return -EBUSY; in dwc3_pci_runtime_suspend()
431 queue_work(pm_wq, &dwc->wakeup_work); in dwc3_pci_runtime_resume()
460 .name = "dwc3-pci",