Lines Matching +full:ulpi +full:- +full:link

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
75 * @pci: our link to PCI bus
94 { "reset-gpios", &reset_gpios, 1 },
95 { "cs-gpios", &cs_gpios, 1 },
115 return -ENOMEM; in dwc3_byt_enable_ulpi_refclock()
119 goto unmap; /* ULPI refclk already enabled */ in dwc3_byt_enable_ulpi_refclock()
153 PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"),
156 PROPERTY_ENTRY_BOOL("snps,usb2-gadget-lpm-disable"),
162 PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
163 PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
183 PROPERTY_ENTRY_BOOL("usb-role-switch"),
184 PROPERTY_ENTRY_STRING("role-switch-default-mode", "host"),
216 struct pci_dev *pdev = dwc->pci; in dwc3_pci_quirks()
218 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in dwc3_pci_quirks()
219 if (pdev->device == PCI_DEVICE_ID_INTEL_BXT || in dwc3_pci_quirks()
220 pdev->device == PCI_DEVICE_ID_INTEL_BXT_M || in dwc3_pci_quirks()
221 pdev->device == PCI_DEVICE_ID_INTEL_EHL) { in dwc3_pci_quirks()
222 guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid); in dwc3_pci_quirks()
223 dwc->has_dsm_for_pm = true; in dwc3_pci_quirks()
226 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) { in dwc3_pci_quirks()
236 ret = devm_acpi_dev_add_driver_gpios(&pdev->dev, in dwc3_pci_quirks()
239 dev_dbg(&pdev->dev, "failed to add mapping table\n"); in dwc3_pci_quirks()
247 if (acpi_dev_present("INT33FC", NULL, -1)) in dwc3_pci_quirks()
255 gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); in dwc3_pci_quirks()
262 gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); in dwc3_pci_quirks()
274 * and patch the phy dev-name into the lookup table so in dwc3_pci_quirks()
275 * that the phy-driver can get the GPIOs. in dwc3_pci_quirks()
277 dwc->dwc3->id = PLATFORM_DEVID_NONE; in dwc3_pci_quirks()
278 platform_bytcr_gpios.dev_id = "dwc3.ulpi"; in dwc3_pci_quirks()
292 dev_info(&pdev->dev, "Using TUSB1211 phy for charger detection\n"); in dwc3_pci_quirks()
298 return device_add_software_node(&dwc->dwc3->dev, swnode); in dwc3_pci_quirks()
305 struct platform_device *dwc3 = dwc->dwc3; in dwc3_pci_resume_work()
308 ret = pm_runtime_get_sync(&dwc3->dev); in dwc3_pci_resume_work()
310 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
314 pm_runtime_mark_last_busy(&dwc3->dev); in dwc3_pci_resume_work()
315 pm_runtime_put_sync_autosuspend(&dwc3->dev); in dwc3_pci_resume_work()
324 struct device *dev = &pci->dev; in dwc3_pci_probe()
329 return -ENODEV; in dwc3_pci_probe()
336 return -ENOMEM; in dwc3_pci_probe()
338 dwc->dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); in dwc3_pci_probe()
339 if (!dwc->dwc3) in dwc3_pci_probe()
340 return -ENOMEM; in dwc3_pci_probe()
349 res[1].start = pci->irq; in dwc3_pci_probe()
353 ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); in dwc3_pci_probe()
359 dwc->pci = pci; in dwc3_pci_probe()
360 dwc->dwc3->dev.parent = dev; in dwc3_pci_probe()
361 ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev)); in dwc3_pci_probe()
363 ret = dwc3_pci_quirks(dwc, (void *)id->driver_data); in dwc3_pci_probe()
367 ret = platform_device_add(dwc->dwc3); in dwc3_pci_probe()
377 INIT_WORK(&dwc->wakeup_work, dwc3_pci_resume_work); in dwc3_pci_probe()
382 device_remove_software_node(&dwc->dwc3->dev); in dwc3_pci_probe()
383 platform_device_put(dwc->dwc3); in dwc3_pci_probe()
390 struct pci_dev *pdev = dwc->pci; in dwc3_pci_remove()
392 if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) in dwc3_pci_remove()
395 cancel_work_sync(&dwc->wakeup_work); in dwc3_pci_remove()
397 device_init_wakeup(&pci->dev, false); in dwc3_pci_remove()
398 pm_runtime_get(&pci->dev); in dwc3_pci_remove()
399 device_remove_software_node(&dwc->dwc3->dev); in dwc3_pci_remove()
400 platform_device_unregister(dwc->dwc3); in dwc3_pci_remove()
456 if (!dwc->has_dsm_for_pm) in dwc3_pci_dsm()
462 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), &dwc->guid, in dwc3_pci_dsm()
465 dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n"); in dwc3_pci_dsm()
466 return -EIO; in dwc3_pci_dsm()
483 return -EBUSY; in dwc3_pci_runtime_suspend()
495 queue_work(pm_wq, &dwc->wakeup_work); in dwc3_pci_runtime_resume()
524 .name = "dwc3-pci",