Lines Matching refs:pdev
43 static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
53 func = pci_get_device(pdev->vendor, pdev->device, NULL);
57 if (func->devfn == pdev->devfn) {
58 func = pci_get_device(pdev->vendor, pdev->device, func);
71 static int cdns3_pci_probe(struct pci_dev *pdev,
84 if (!id || (pdev->devfn != PCI_DEV_FN_HOST_DEVICE &&
85 pdev->devfn != PCI_DEV_FN_OTG))
88 func = cdns3_get_second_fun(pdev);
92 err = pcim_enable_device(pdev);
94 dev_err(&pdev->dev, "Enabling PCI device has failed %d\n", err);
98 pci_set_master(pdev);
105 pci_disable_device(pdev);
112 if (pdev->devfn == PCI_DEV_FN_HOST_DEVICE) {
114 dev_dbg(&pdev->dev, "Initialize Device resources\n");
115 res[RES_DEV_ID].start = pci_resource_start(pdev, PCI_BAR_DEV);
116 res[RES_DEV_ID].end = pci_resource_end(pdev, PCI_BAR_DEV);
119 dev_dbg(&pdev->dev, "USBSS-DEV physical base addr: %pa\n",
122 res[RES_HOST_ID].start = pci_resource_start(pdev, PCI_BAR_HOST);
123 res[RES_HOST_ID].end = pci_resource_end(pdev, PCI_BAR_HOST);
126 dev_dbg(&pdev->dev, "USBSS-XHCI physical base addr: %pa\n",
130 wrap->dev_res[RES_IRQ_HOST_ID].start = pdev->irq;
135 wrap->dev_res[RES_IRQ_PERIPHERAL_ID].start = pdev->irq;
139 res[RES_DRD_ID].start = pci_resource_start(pdev, PCI_BAR_OTG);
140 res[RES_DRD_ID].end = pci_resource_end(pdev, PCI_BAR_OTG);
143 dev_dbg(&pdev->dev, "USBSS-DRD physical base addr: %pa\n",
147 wrap->dev_res[RES_IRQ_OTG_ID].start = pdev->irq;
155 plat_info.parent = &pdev->dev;
156 plat_info.fwnode = pdev->dev.fwnode;
158 plat_info.id = pdev->devfn;
159 wrap->devfn = pdev->devfn;
162 plat_info.dma_mask = pdev->dma_mask;
166 pci_disable_device(pdev);
173 pci_set_drvdata(pdev, wrap);
177 static void cdns3_pci_remove(struct pci_dev *pdev)
182 func = cdns3_get_second_fun(pdev);
184 wrap = (struct cdns3_wrap *)pci_get_drvdata(pdev);
185 if (wrap->devfn == pdev->devfn)