1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2019 Google, Inc
12 * pci_get_devfn() - Extract the devfn from fdt_pci_addr of the device
14 * Get devfn from fdt_pci_addr of the specified device
16 * This returns an int to avoid a dependency on pci.h
19 * Return: devfn in bits 15...8 if found (pci_dev_t format), or -ENODEV if not
22 int pci_get_devfn(struct udevice *dev);
25 * pci_ofplat_get_devfn() - Get the PCI dev/fn from of-platdata
27 * This function is used to obtain a PCI device/function from of-platdata
28 * register data. In this case the first cell of the 'reg' property contains
29 * the required information.
31 * This returns an int to avoid a dependency on pci.h
33 * @reg: reg value from dt-plat.c array (first member). This is not a
34 * pointer type, since the caller may use fdt32_t or fdt64_t depending on
36 * Return: device/function for that device (pci_dev_t format)
38 static inline int pci_ofplat_get_devfn(u32 reg)