// SPDX-License-Identifier: GPL-2.0 /* * ci_hdrc_pci.c - MIPS USB IP core family device controller * * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved. * * Author: David Lopo
*/
/** * ci_hdrc_pci_probe: PCI probe * @pdev: USB device controller being probed * @id: PCI hotplug ID connecting controller to UDC framework * * This function returns an error code * Allocates basic PCI resources for this USB device controller, and then * invokes the udc_probe() method to start the UDC associated with it
*/ staticint ci_hdrc_pci_probe(struct pci_dev *pdev, conststruct pci_device_id *id)
{ struct ci_hdrc_platform_data *platdata = (void *)id->driver_data; struct ci_hdrc_pci *ci; struct resource res[3]; int retval = 0, nres = 2;
if (!platdata) {
dev_err(&pdev->dev, "device doesn't provide driver data\n"); return -ENODEV;
}
ci = devm_kzalloc(&pdev->dev, sizeof(*ci), GFP_KERNEL); if (!ci) return -ENOMEM;
retval = pcim_enable_device(pdev); if (retval) return retval;
if (!pdev->irq) {
dev_err(&pdev->dev, "No IRQ, check BIOS/PCI setup!"); return -ENODEV;
}
pci_set_master(pdev);
pci_try_set_mwi(pdev);
/* register a nop PHY */
ci->phy = usb_phy_generic_register(); if (IS_ERR(ci->phy)) return PTR_ERR(ci->phy);
/** * ci_hdrc_pci_remove: PCI remove * @pdev: USB Device Controller being removed * * Reverses the effect of ci_hdrc_pci_probe(), * first invoking the udc_remove() and then releases * all PCI resources allocated for this USB device controller
*/ staticvoid ci_hdrc_pci_remove(struct pci_dev *pdev)
{ struct ci_hdrc_pci *ci = pci_get_drvdata(pdev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.