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
63 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
73 * struct dwc3_pci - Driver private structure
94 { "reset-gpios", &reset_gpios, 1 },
95 { "cs-gpios", &cs_gpios, 1 },
115 return -ENOMEM;
153 * be re-allocated if being used because the side band flow control signals
155 * - 1 High BW Bulk IN (IN#1) (RTIT)
156 * - 1 1KB BW Bulk IN (IN#8) + 1 1KB BW Bulk OUT (Run Control) (OUT#8)
162 PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"),
165 PROPERTY_ENTRY_U8_ARRAY("snps,reserved-endpoints", dwc3_pci_mrfld_reserved_endpoints),
166 PROPERTY_ENTRY_BOOL("snps,usb2-gadget-lpm-disable"),
172 PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
173 PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
193 PROPERTY_ENTRY_BOOL("usb-role-switch"),
194 PROPERTY_ENTRY_STRING("role-switch-default-mode", "host"),
226 struct pci_dev *pdev = dwc->pci;
228 if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
229 if (pdev->device == PCI_DEVICE_ID_INTEL_BXT ||
230 pdev->device == PCI_DEVICE_ID_INTEL_BXT_M ||
231 pdev->device == PCI_DEVICE_ID_INTEL_EHL) {
232 guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid);
233 dwc->has_dsm_for_pm = true;
236 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) {
246 ret = devm_acpi_dev_add_driver_gpios(&pdev->dev,
249 dev_dbg(&pdev->dev, "failed to add mapping table\n");
257 if (acpi_dev_present("INT33FC", NULL, -1))
265 gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
272 gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
284 * and patch the phy dev-name into the lookup table so
285 * that the phy-driver can get the GPIOs.
287 dwc->dwc3->id = PLATFORM_DEVID_NONE;
302 dev_info(&pdev->dev, "Using TUSB1211 phy for charger detection\n");
308 return device_add_software_node(&dwc->dwc3->dev, swnode);
315 struct platform_device *dwc3 = dwc->dwc3;
318 ret = pm_runtime_get_sync(&dwc3->dev);
320 pm_runtime_put_sync_autosuspend(&dwc3->dev);
324 pm_runtime_mark_last_busy(&dwc3->dev);
325 pm_runtime_put_sync_autosuspend(&dwc3->dev);
334 struct device *dev = &pci->dev;
339 return -ENODEV;
346 return -ENOMEM;
348 dwc->dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO);
349 if (!dwc->dwc3)
350 return -ENOMEM;
359 res[1].start = pci->irq;
363 ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res));
369 dwc->pci = pci;
370 dwc->dwc3->dev.parent = dev;
371 ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev));
373 ret = dwc3_pci_quirks(dwc, (void *)id->driver_data);
377 ret = platform_device_add(dwc->dwc3);
387 INIT_WORK(&dwc->wakeup_work, dwc3_pci_resume_work);
392 device_remove_software_node(&dwc->dwc3->dev);
393 platform_device_put(dwc->dwc3);
400 struct pci_dev *pdev = dwc->pci;
402 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT)
405 cancel_work_sync(&dwc->wakeup_work);
407 device_init_wakeup(&pci->dev, false);
408 pm_runtime_get(&pci->dev);
409 device_remove_software_node(&dwc->dwc3->dev);
410 platform_device_unregister(dwc->dwc3);
466 if (!dwc->has_dsm_for_pm)
472 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), &dwc->guid,
475 dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n");
476 return -EIO;
493 return -EBUSY;
505 queue_work(pm_wq, &dwc->wakeup_work);
534 .name = "dwc3-pci",