]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/of_pci.h
tun: call dev_get_valid_name() before register_netdevice()
[mirror_ubuntu-artful-kernel.git] / include / linux / of_pci.h
CommitLineData
04bea68b
SAS
1#ifndef __OF_PCI_H
2#define __OF_PCI_H
3
4#include <linux/pci.h>
0d5a6db3 5#include <linux/msi.h>
04bea68b
SAS
6
7struct pci_dev;
530210c7 8struct of_phandle_args;
98d9f30c 9struct device_node;
64c5c759 10
5c1d3310 11#ifdef CONFIG_OF_PCI
64c5c759 12int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq);
98d9f30c
BH
13struct device_node *of_pci_find_child_device(struct device_node *parent,
14 unsigned int devfn);
45ab9702 15int of_pci_get_devfn(struct device_node *np);
64c5c759 16int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
4e23d3f5 17int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
41e5c0f8 18int of_get_pci_domain_nr(struct device_node *node);
9a1dc389 19int of_pci_get_max_link_speed(struct device_node *node);
f81c11af 20void of_pci_check_probe_only(void);
987068fc
RM
21int of_pci_map_rid(struct device_node *np, u32 rid,
22 const char *map_name, const char *map_mask_name,
23 struct device_node **target, u32 *id_out);
64c5c759
AB
24#else
25static inline int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq)
26{
27 return 0;
28}
29
30static inline struct device_node *of_pci_find_child_device(struct device_node *parent,
31 unsigned int devfn)
32{
33 return NULL;
34}
35
36static inline int of_pci_get_devfn(struct device_node *np)
37{
38 return -EINVAL;
39}
40
41static inline int
42of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
43{
44 return 0;
45}
46
47static inline int
48of_pci_parse_bus_range(struct device_node *node, struct resource *res)
49{
50 return -EINVAL;
51}
41e5c0f8
LD
52
53static inline int
54of_get_pci_domain_nr(struct device_node *node)
55{
56 return -1;
57}
c49b8fc2 58
987068fc
RM
59static inline int of_pci_map_rid(struct device_node *np, u32 rid,
60 const char *map_name, const char *map_mask_name,
61 struct device_node **target, u32 *id_out)
62{
63 return -EINVAL;
9a1dc389
SL
64}
65
66static inline int
67of_pci_get_max_link_speed(struct device_node *node)
68{
69 return -EINVAL;
987068fc
RM
70}
71
f81c11af 72static inline void of_pci_check_probe_only(void) { }
64c5c759 73#endif
98d9f30c 74
cbe4097f
LD
75#if defined(CONFIG_OF_ADDRESS)
76int of_pci_get_host_bridge_resources(struct device_node *dev,
77 unsigned char busno, unsigned char bus_max,
78 struct list_head *resources, resource_size_t *io_base);
40704b12
AB
79#else
80static inline int of_pci_get_host_bridge_resources(struct device_node *dev,
81 unsigned char busno, unsigned char bus_max,
82 struct list_head *resources, resource_size_t *io_base)
83{
84 return -EINVAL;
85}
cbe4097f
LD
86#endif
87
04bea68b 88#endif