summaryrefslogtreecommitdiff
path: root/include/pci.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-29 13:17:50 -0700
committerSimon Glass <sjg@chromium.org>2016-01-12 10:19:09 -0700
commit5c0bf647c4e1659fdeb83a66f56ec27add72b561 (patch)
tree0bec69f961eac0879e0c7e842214eb9b757b0f6e /include/pci.h
parent5e23b8b4a4a63178015432a94617d937d8eb42cd (diff)
dm: pci: Add a driver-model version of pci_find_device()
Add a function which scans the driver model device information rather than scanning the PCI bus again. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/pci.h')
-rw-r--r--include/pci.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h
index 182290c3c27..347dd0af59b 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -1167,6 +1167,18 @@ int pci_get_regions(struct udevice *dev, struct pci_region **iop,
struct pci_region **memp, struct pci_region **prefp);
/**
+ * dm_pci_find_device() - find a device by vendor/device ID
+ *
+ * @vendor: Vendor ID
+ * @device: Device ID
+ * @index: 0 to find the first match, 1 for second, etc.
+ * @devp: Returns pointer to the device, if found
+ * @return 0 if found, -ve on error
+ */
+int dm_pci_find_device(unsigned int vendor, unsigned int device, int index,
+ struct udevice **devp);
+
+/**
* struct dm_pci_emul_ops - PCI device emulator operations
*/
struct dm_pci_emul_ops {