Lines Matching +full:lpm +full:- +full:nyet +full:- +full:threshold

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
55 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
65 * struct dwc3_pci - Driver private structure
86 { "reset-gpios", &reset_gpios, 1 },
87 { "cs-gpios", &cs_gpios, 1 },
107 return -ENOMEM; in dwc3_byt_enable_ulpi_refclock()
145 PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"),
148 PROPERTY_ENTRY_BOOL("snps,usb2-gadget-lpm-disable"),
154 PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
155 PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
175 PROPERTY_ENTRY_BOOL("usb-role-switch"),
176 PROPERTY_ENTRY_STRING("role-switch-default-mode", "host"),
208 struct pci_dev *pdev = dwc->pci; in dwc3_pci_quirks()
210 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in dwc3_pci_quirks()
211 if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || in dwc3_pci_quirks()
212 pdev->device == PCI_DEVICE_ID_INTEL_BXT_M || in dwc3_pci_quirks()
213 pdev->device == PCI_DEVICE_ID_INTEL_EHL) { 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()
218 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) { in dwc3_pci_quirks()
227 ret = devm_acpi_dev_add_driver_gpios(&pdev->dev, in dwc3_pci_quirks()
230 dev_dbg(&pdev->dev, "failed to add mapping table\n"); in dwc3_pci_quirks()
244 gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); in dwc3_pci_quirks()
251 gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); in dwc3_pci_quirks()
263 * and patch the phy dev-name into the lookup table so in dwc3_pci_quirks()
264 * that the phy-driver can get the GPIOs. in dwc3_pci_quirks()
266 dwc->dwc3->id = PLATFORM_DEVID_NONE; in dwc3_pci_quirks()
277 dev_info(&pdev->dev, "Using TUSB1211 phy for charger detection\n"); in dwc3_pci_quirks()
283 return device_add_software_node(&dwc->dwc3->dev, swnode); in dwc3_pci_quirks()
290 struct platform_device *dwc3 = dwc->dwc3; in dwc3_pci_resume_work()
293 ret = pm_runtime_get_sync(&dwc3->dev); in dwc3_pci_resume_work()
295 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
299 pm_runtime_mark_last_busy(&dwc3->dev); in dwc3_pci_resume_work()
300 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
309 struct device *dev = &pci->dev; in dwc3_pci_probe()
314 return -ENODEV; in dwc3_pci_probe()
321 return -ENOMEM; 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()
325 return -ENOMEM; in dwc3_pci_probe()
334 res[1].start = pci->irq; 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()
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()
375 struct pci_dev *pdev = dwc->pci; in dwc3_pci_remove()
377 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) in dwc3_pci_remove()
380 cancel_work_sync(&dwc->wakeup_work); in dwc3_pci_remove()
382 device_init_wakeup(&pci->dev, false); in dwc3_pci_remove()
383 pm_runtime_get(&pci->dev); 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()
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()
506 return -EIO; in dwc3_pci_dsm()
523 return -EBUSY; in dwc3_pci_runtime_suspend()
535 queue_work(pm_wq, &dwc->wakeup_work); in dwc3_pci_runtime_resume()
564 .name = "dwc3-pci",