2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2011-01-24 09:58:55 +05:30
|
|
|
#ifndef __OF_PCI_H
|
|
|
|
|
#define __OF_PCI_H
|
|
|
|
|
|
2019-09-03 13:30:59 +02:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
#include <linux/errno.h>
|
2011-01-24 09:58:55 +05:30
|
|
|
|
|
|
|
|
struct pci_dev;
|
2011-04-11 11:37:07 +10:00
|
|
|
struct device_node;
|
2014-06-04 04:40:19 -05:00
|
|
|
|
2018-01-17 17:36:39 -06:00
|
|
|
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
|
2011-04-11 11:37:07 +10:00
|
|
|
struct device_node *of_pci_find_child_device(struct device_node *parent,
|
|
|
|
|
unsigned int devfn);
|
2013-05-16 17:55:18 +02:00
|
|
|
int of_pci_get_devfn(struct device_node *np);
|
2015-09-04 17:50:08 +01:00
|
|
|
void of_pci_check_probe_only(void);
|
2014-06-04 04:40:19 -05:00
|
|
|
#else
|
|
|
|
|
static inline struct device_node *of_pci_find_child_device(struct device_node *parent,
|
|
|
|
|
unsigned int devfn)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int of_pci_get_devfn(struct device_node *np)
|
|
|
|
|
{
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-04 17:50:08 +01:00
|
|
|
static inline void of_pci_check_probe_only(void) { }
|
2014-06-04 04:40:19 -05:00
|
|
|
#endif
|
2011-04-11 11:37:07 +10:00
|
|
|
|
2018-03-05 15:22:30 -08:00
|
|
|
#if IS_ENABLED(CONFIG_OF_IRQ)
|
|
|
|
|
int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
|
|
|
|
|
#else
|
|
|
|
|
static inline int
|
|
|
|
|
of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-01-24 09:58:55 +05:30
|
|
|
#endif
|