summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2019-01-25 11:52:42 +0100
committerStefan Roese <sr@denx.de>2019-02-05 14:22:24 +0100
commitb52142004fbdfd6db0091ba7ae33c91e3b459034 (patch)
tree82a451e32969f8ee4d49448b82f751ecdb816f41 /include
parente5fd39c886485e3dec77f4438a6e364c2987cf5f (diff)
pci: Add pci_get_devfn() to extract devfn from the fdt_pci_addr
This function will be used by the Marvell Armada XP/38x PCIe driver, which is moved to DM right now. So let's extract the functionality from pci_uclass_child_post_bind() to make it available. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/pci.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h
index 785d7d28b7..041f8e3747 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -1560,6 +1560,16 @@ struct dm_pci_emul_ops {
int sandbox_pci_get_emul(struct udevice *bus, pci_dev_t find_devfn,
struct udevice **containerp, struct udevice **emulp);
+/**
+ * pci_get_devfn() - Extract the devfn from fdt_pci_addr of the device
+ *
+ * Get devfn from fdt_pci_addr of the specifified device
+ *
+ * @dev: PCI device
+ * @return devfn in bits 15...8 if found, -ENODEV if not found
+ */
+int pci_get_devfn(struct udevice *dev);
+
#endif /* CONFIG_DM_PCI */
/**