diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-06-08 09:48:06 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-07-05 18:14:25 -0400 |
commit | 7dc2e1134a22dc242175d5321c0c9e97d16eb87b (patch) | |
tree | 213406e4688340c788b40a8eb272255e8c44c8fe /arch/powerpc/include | |
parent | b83da291b4c73eaddc20e2edb614123a6d681b3b (diff) |
of/irq: merge irq mapping code
Merge common irq mapping code between PowerPC and Microblaze.
This patch merges of_irq_find_parent(), of_irq_map_raw() and
of_irq_map_one(). The functions are dependent on one another, so all
three are merged in a single patch. Other than cosmetic difference
(ie. DBG() vs. pr_debug()), the implementations are identical.
of_irq_to_resource() is also merged, but in this case the
implementations are different. This patch drops the microblaze version
and uses the powerpc implementation unchanged. The microblaze version
essentially open-coded irq_of_parse_and_map() which it does not need
to do. Therefore the powerpc version is safe to adopt.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Michal Simek <monstr@monstr.eu>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/prom.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 4486765db6e7..10d5ee556702 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -105,50 +105,6 @@ struct device_node *of_find_next_cache_node(struct device_node *np); | |||
105 | /* Get the MAC address */ | 105 | /* Get the MAC address */ |
106 | extern const void *of_get_mac_address(struct device_node *np); | 106 | extern const void *of_get_mac_address(struct device_node *np); |
107 | 107 | ||
108 | /* | ||
109 | * OF interrupt mapping | ||
110 | */ | ||
111 | |||
112 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
113 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
114 | |||
115 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) | ||
116 | /* Workarounds only needed for 32bit powermac machines */ | ||
117 | extern unsigned int of_irq_workarounds; | ||
118 | extern struct device_node *of_irq_dflt_pic; | ||
119 | extern int of_irq_map_oldworld(struct device_node *device, int index, | ||
120 | struct of_irq *out_irq); | ||
121 | #else | ||
122 | #define of_irq_workarounds (0) | ||
123 | #define of_irq_dflt_pic (NULL) | ||
124 | static inline int of_irq_map_oldworld(struct device_node *device, int index, | ||
125 | struct of_irq *out_irq) | ||
126 | { | ||
127 | return -EINVAL; | ||
128 | } | ||
129 | #endif | ||
130 | |||
131 | /** | ||
132 | * of_irq_map_raw - Low level interrupt tree parsing | ||
133 | * @parent: the device interrupt parent | ||
134 | * @intspec: interrupt specifier ("interrupts" property of the device) | ||
135 | * @ointsize: size of the passed in interrupt specifier | ||
136 | * @addr: address specifier (start of "reg" property of the device) | ||
137 | * @out_irq: structure of_irq filled by this function | ||
138 | * | ||
139 | * Returns 0 on success and a negative number on error | ||
140 | * | ||
141 | * This function is a low-level interrupt tree walking function. It | ||
142 | * can be used to do a partial walk with synthetized reg and interrupts | ||
143 | * properties, for example when resolving PCI interrupts when no device | ||
144 | * node exist for the parent. | ||
145 | * | ||
146 | */ | ||
147 | |||
148 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | ||
149 | u32 ointsize, const u32 *addr, | ||
150 | struct of_irq *out_irq); | ||
151 | |||
152 | /** | 108 | /** |
153 | * of_irq_map_pci - Resolve the interrupt for a PCI device | 109 | * of_irq_map_pci - Resolve the interrupt for a PCI device |
154 | * @pdev: the device whose interrupt is to be resolved | 110 | * @pdev: the device whose interrupt is to be resolved |
@@ -163,9 +119,6 @@ extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | |||
163 | struct pci_dev; | 119 | struct pci_dev; |
164 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | 120 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
165 | 121 | ||
166 | extern int of_irq_to_resource(struct device_node *dev, int index, | ||
167 | struct resource *r); | ||
168 | |||
169 | /** | 122 | /** |
170 | * of_iomap - Maps the memory mapped IO for a given device_node | 123 | * of_iomap - Maps the memory mapped IO for a given device_node |
171 | * @device: the device whose io range will be mapped | 124 | * @device: the device whose io range will be mapped |