Lines Matching +full:pci +full:- +full:phy

1 // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
3 * pci.c - DesignWare HS OTG Controller PCI driver
5 * Copyright (C) 2004-2013 Synopsys, Inc.
9 * Provides the initialization and cleanup entry points for the DWC_otg PCI
19 #include <linux/pci.h>
29 static const char dwc2_driver_name[] = "dwc2-pci";
33 struct platform_device *phy; member
37 * dwc2_pci_remove() - Provides the cleanup entry points for the DWC_otg PCI
40 * @pci: The programming view of DWC_otg PCI
42 static void dwc2_pci_remove(struct pci_dev *pci) in dwc2_pci_remove() argument
44 struct dwc2_pci_glue *glue = pci_get_drvdata(pci); in dwc2_pci_remove()
46 platform_device_unregister(glue->dwc2); in dwc2_pci_remove()
47 usb_phy_generic_unregister(glue->phy); in dwc2_pci_remove()
48 pci_set_drvdata(pci, NULL); in dwc2_pci_remove()
51 static int dwc2_pci_probe(struct pci_dev *pci, in dwc2_pci_probe() argument
56 struct platform_device *phy; in dwc2_pci_probe() local
58 struct device *dev = &pci->dev; in dwc2_pci_probe()
61 ret = pcim_enable_device(pci); in dwc2_pci_probe()
63 dev_err(dev, "failed to enable pci device\n"); in dwc2_pci_probe()
64 return -ENODEV; in dwc2_pci_probe()
67 pci_set_master(pci); in dwc2_pci_probe()
69 phy = usb_phy_generic_register(); in dwc2_pci_probe()
70 if (IS_ERR(phy)) { in dwc2_pci_probe()
71 dev_err(dev, "error registering generic PHY (%ld)\n", in dwc2_pci_probe()
72 PTR_ERR(phy)); in dwc2_pci_probe()
73 return PTR_ERR(phy); in dwc2_pci_probe()
79 ret = -ENOMEM; in dwc2_pci_probe()
85 res[0].start = pci_resource_start(pci, 0); in dwc2_pci_probe()
86 res[0].end = pci_resource_end(pci, 0); in dwc2_pci_probe()
90 res[1].start = pci->irq; in dwc2_pci_probe()
100 dwc2->dev.parent = dev; in dwc2_pci_probe()
104 ret = -ENOMEM; in dwc2_pci_probe()
114 glue->phy = phy; in dwc2_pci_probe()
115 glue->dwc2 = dwc2; in dwc2_pci_probe()
116 pci_set_drvdata(pci, glue); in dwc2_pci_probe()
120 usb_phy_generic_unregister(phy); in dwc2_pci_probe()
135 MODULE_DEVICE_TABLE(pci, dwc2_pci_ids);
146 MODULE_DESCRIPTION("DESIGNWARE HS OTG PCI Bus Glue");