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

1 // SPDX-License-Identifier: GPL-2.0
3 * ci_hdrc_pci.c - MIPS USB IP core family device controller
5 * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
12 #include <linux/pci.h>
23 struct platform_device *phy; member
27 * PCI block
46 * ci_hdrc_pci_probe: PCI probe
48 * @id: PCI hotplug ID connecting controller to UDC framework
51 * Allocates basic PCI resources for this USB device controller, and then
57 struct ci_hdrc_platform_data *platdata = (void *)id->driver_data; in ci_hdrc_pci_probe()
63 dev_err(&pdev->dev, "device doesn't provide driver data\n"); in ci_hdrc_pci_probe()
64 return -ENODEV; in ci_hdrc_pci_probe()
67 ci = devm_kzalloc(&pdev->dev, sizeof(*ci), GFP_KERNEL); in ci_hdrc_pci_probe()
69 return -ENOMEM; in ci_hdrc_pci_probe()
75 if (!pdev->irq) { in ci_hdrc_pci_probe()
76 dev_err(&pdev->dev, "No IRQ, check BIOS/PCI setup!"); in ci_hdrc_pci_probe()
77 return -ENODEV; in ci_hdrc_pci_probe()
83 /* register a nop PHY */ in ci_hdrc_pci_probe()
84 ci->phy = usb_phy_generic_register(); in ci_hdrc_pci_probe()
85 if (IS_ERR(ci->phy)) in ci_hdrc_pci_probe()
86 return PTR_ERR(ci->phy); in ci_hdrc_pci_probe()
92 res[1].start = pdev->irq; in ci_hdrc_pci_probe()
95 ci->ci = ci_hdrc_add_device(&pdev->dev, res, nres, platdata); in ci_hdrc_pci_probe()
96 if (IS_ERR(ci->ci)) { in ci_hdrc_pci_probe()
97 dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); in ci_hdrc_pci_probe()
98 usb_phy_generic_unregister(ci->phy); in ci_hdrc_pci_probe()
99 return PTR_ERR(ci->ci); in ci_hdrc_pci_probe()
108 * ci_hdrc_pci_remove: PCI remove
113 * all PCI resources allocated for this USB device controller
119 ci_hdrc_remove_device(ci->ci); in ci_hdrc_pci_remove()
120 usb_phy_generic_unregister(ci->phy); in ci_hdrc_pci_remove()
124 * PCI device table
125 * PCI device structure
127 * Check "pci.h" for details
129 * Note: ehci-pci driver may try to probe the device first. You have to add an
130 * ID to the bypass_pci_id_table in ehci-pci driver to prevent this.
156 MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table);
167 MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>");