diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:54:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 17:54:02 -0400 |
| commit | acb41c0f928fdb84a1c3753ac92c534a2a0f08d2 (patch) | |
| tree | 4bf92f1c2b1f36fa68d3e77d646b04b863e1a7e4 /include/linux | |
| parent | 8181780c163e7111f15619067cfa044172d532e1 (diff) | |
| parent | ef3b4f8cc20e80c767e47b848fb7512770ab80d7 (diff) | |
Merge branch 'of-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'of-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
pci/of: Consolidate pci_bus_to_OF_node()
pci/of: Consolidate pci_device_to_OF_node()
x86/devicetree: Use generic PCI <-> OF matching
microblaze/pci: Move the remains of pci_32.c to pci-common.c
microblaze/pci: Remove powermac originated cruft
pci/of: Match PCI devices to OF nodes dynamically
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/of_pci.h | 5 | ||||
| -rw-r--r-- | include/linux/pci.h | 28 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 85a27b650d76..f93e21700d3e 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
| @@ -6,4 +6,9 @@ | |||
| 6 | struct pci_dev; | 6 | struct pci_dev; |
| 7 | struct of_irq; | 7 | struct of_irq; |
| 8 | int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | 8 | int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
| 9 | |||
| 10 | struct device_node; | ||
| 11 | struct device_node *of_pci_find_child_device(struct device_node *parent, | ||
| 12 | unsigned int devfn); | ||
| 13 | |||
| 9 | #endif | 14 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c446b5ca2d38..2d292182dde5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -1589,5 +1589,33 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); | |||
| 1589 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | 1589 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, |
| 1590 | unsigned int len, const char *kw); | 1590 | unsigned int len, const char *kw); |
| 1591 | 1591 | ||
| 1592 | /* PCI <-> OF binding helpers */ | ||
| 1593 | #ifdef CONFIG_OF | ||
| 1594 | struct device_node; | ||
| 1595 | extern void pci_set_of_node(struct pci_dev *dev); | ||
| 1596 | extern void pci_release_of_node(struct pci_dev *dev); | ||
| 1597 | extern void pci_set_bus_of_node(struct pci_bus *bus); | ||
| 1598 | extern void pci_release_bus_of_node(struct pci_bus *bus); | ||
| 1599 | |||
| 1600 | /* Arch may override this (weak) */ | ||
| 1601 | extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); | ||
| 1602 | |||
| 1603 | static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | ||
| 1604 | { | ||
| 1605 | return pdev ? pdev->dev.of_node : NULL; | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | ||
| 1609 | { | ||
| 1610 | return bus ? bus->dev.of_node : NULL; | ||
| 1611 | } | ||
| 1612 | |||
| 1613 | #else /* CONFIG_OF */ | ||
| 1614 | static inline void pci_set_of_node(struct pci_dev *dev) { } | ||
| 1615 | static inline void pci_release_of_node(struct pci_dev *dev) { } | ||
| 1616 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } | ||
| 1617 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } | ||
| 1618 | #endif /* CONFIG_OF */ | ||
| 1619 | |||
| 1592 | #endif /* __KERNEL__ */ | 1620 | #endif /* __KERNEL__ */ |
| 1593 | #endif /* LINUX_PCI_H */ | 1621 | #endif /* LINUX_PCI_H */ |
