diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/of.h | 2 | ||||
-rw-r--r-- | include/linux/of_irq.h | 6 | ||||
-rw-r--r-- | include/linux/of_pci.h | 36 |
3 files changed, 42 insertions, 2 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 54c2560..d27359a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -67,7 +67,7 @@ struct device_node { #endif }; -#define MAX_PHANDLE_ARGS 8 +#define MAX_PHANDLE_ARGS 16 struct of_phandle_args { struct device_node *np; int args_count; diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index fcd63ba..9984a3e 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -47,7 +47,10 @@ static inline int of_irq_map_oldworld(struct device_node *device, int index, } #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ - +extern int of_irq_parse_raw(const __be32 *addr, + struct of_phandle_args *out_irq); +extern int of_irq_parse_one(struct device_node *device, int index, + struct of_phandle_args *out_irq); extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, u32 ointsize, const __be32 *addr, struct of_irq *out_irq); @@ -56,6 +59,7 @@ extern int of_irq_map_one(struct device_node *device, int index, extern unsigned int irq_create_of_mapping(struct device_node *controller, const u32 *intspec, unsigned int intsize); +extern unsigned int irq_create_of_mapping_new(struct of_phandle_args *irq_data); extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); extern int of_irq_count(struct device_node *dev); diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index fd9c408..790db04 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -5,14 +5,50 @@ #include <linux/msi.h> struct pci_dev; +struct of_phandle_args; struct of_irq; int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); struct device_node; + +#ifdef CONFIG_OF +int of_irq_parse_pci(const struct pci_dev *pdev, + struct of_phandle_args *out_irq); struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn); int of_pci_get_devfn(struct device_node *np); +int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); int of_pci_parse_bus_range(struct device_node *node, struct resource *res); +#else +static inline int of_irq_parse_pci(const struct pci_dev *pdev, + struct of_phandle_args *out_irq) +{ + return 0; +} + +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; +} + +static inline int +of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) +{ + return 0; +} + +static inline int +of_pci_parse_bus_range(struct device_node *node, struct resource *res) +{ + return -EINVAL; +} +#endif #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) int of_pci_msi_chip_add(struct msi_chip *chip); |