Lines Matching refs:pdev
43 static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev) in cdns3_get_second_fun() argument
53 func = pci_get_device(pdev->vendor, pdev->device, NULL); in cdns3_get_second_fun()
57 if (func->devfn == pdev->devfn) { in cdns3_get_second_fun()
58 func = pci_get_device(pdev->vendor, pdev->device, func); in cdns3_get_second_fun()
66 static int cdns3_pci_probe(struct pci_dev *pdev, in cdns3_pci_probe() argument
79 if (!id || (pdev->devfn != PCI_DEV_FN_HOST_DEVICE && in cdns3_pci_probe()
80 pdev->devfn != PCI_DEV_FN_OTG)) in cdns3_pci_probe()
83 func = cdns3_get_second_fun(pdev); in cdns3_pci_probe()
87 err = pcim_enable_device(pdev); in cdns3_pci_probe()
89 dev_err(&pdev->dev, "Enabling PCI device has failed %d\n", err); in cdns3_pci_probe()
93 pci_set_master(pdev); in cdns3_pci_probe()
100 pci_disable_device(pdev); in cdns3_pci_probe()
107 if (pdev->devfn == PCI_DEV_FN_HOST_DEVICE) { in cdns3_pci_probe()
109 dev_dbg(&pdev->dev, "Initialize Device resources\n"); in cdns3_pci_probe()
110 res[RES_DEV_ID].start = pci_resource_start(pdev, PCI_BAR_DEV); in cdns3_pci_probe()
111 res[RES_DEV_ID].end = pci_resource_end(pdev, PCI_BAR_DEV); in cdns3_pci_probe()
114 dev_dbg(&pdev->dev, "USBSS-DEV physical base addr: %pa\n", in cdns3_pci_probe()
117 res[RES_HOST_ID].start = pci_resource_start(pdev, PCI_BAR_HOST); in cdns3_pci_probe()
118 res[RES_HOST_ID].end = pci_resource_end(pdev, PCI_BAR_HOST); in cdns3_pci_probe()
121 dev_dbg(&pdev->dev, "USBSS-XHCI physical base addr: %pa\n", in cdns3_pci_probe()
125 wrap->dev_res[RES_IRQ_HOST_ID].start = pdev->irq; in cdns3_pci_probe()
130 wrap->dev_res[RES_IRQ_PERIPHERAL_ID].start = pdev->irq; in cdns3_pci_probe()
134 res[RES_DRD_ID].start = pci_resource_start(pdev, PCI_BAR_OTG); in cdns3_pci_probe()
135 res[RES_DRD_ID].end = pci_resource_end(pdev, PCI_BAR_OTG); in cdns3_pci_probe()
138 dev_dbg(&pdev->dev, "USBSS-DRD physical base addr: %pa\n", in cdns3_pci_probe()
142 wrap->dev_res[RES_IRQ_OTG_ID].start = pdev->irq; in cdns3_pci_probe()
150 plat_info.parent = &pdev->dev; in cdns3_pci_probe()
151 plat_info.fwnode = pdev->dev.fwnode; in cdns3_pci_probe()
153 plat_info.id = pdev->devfn; in cdns3_pci_probe()
154 wrap->devfn = pdev->devfn; in cdns3_pci_probe()
157 plat_info.dma_mask = pdev->dma_mask; in cdns3_pci_probe()
161 pci_disable_device(pdev); in cdns3_pci_probe()
168 pci_set_drvdata(pdev, wrap); in cdns3_pci_probe()
172 static void cdns3_pci_remove(struct pci_dev *pdev) in cdns3_pci_remove() argument
177 func = cdns3_get_second_fun(pdev); in cdns3_pci_remove()
179 wrap = (struct cdns3_wrap *)pci_get_drvdata(pdev); in cdns3_pci_remove()
180 if (wrap->devfn == pdev->devfn) in cdns3_pci_remove()