diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-01-24 19:09:13 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 08:11:24 -0500 |
commit | ff8c3ab8161d0df52858966e0347e05791da40df (patch) | |
tree | f0c17341977c555165d332033c03067d768ed0db /arch | |
parent | 9f70b8eb3cd37c6ef3371f972db799250e3eb86e (diff) |
irq_domain/powerpc: Replace custom xlate functions with library functions
This patch converts a number of the powerpc drivers to use the common library
of irq_domain xlate functions, dropping a bunch of lines in the process.
v5: - Remove tsi108 changes from patch
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 13 | ||||
-rw-r--r-- | arch/powerpc/platforms/wsp/opb_pic.c | 13 | ||||
-rw-r--r-- | arch/powerpc/sysdev/cpm2_pic.c | 14 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ipic.c | 18 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe_ic.c | 15 | ||||
-rw-r--r-- | arch/powerpc/sysdev/uic.c | 14 |
6 files changed, 6 insertions, 81 deletions
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 46a5f32e958b..92afc382a49e 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -288,21 +288,10 @@ static int pmac_pic_host_map(struct irq_domain *h, unsigned int virq, | |||
288 | return 0; | 288 | return 0; |
289 | } | 289 | } |
290 | 290 | ||
291 | static int pmac_pic_host_xlate(struct irq_domain *h, struct device_node *ct, | ||
292 | const u32 *intspec, unsigned int intsize, | ||
293 | irq_hw_number_t *out_hwirq, | ||
294 | unsigned int *out_flags) | ||
295 | |||
296 | { | ||
297 | *out_flags = IRQ_TYPE_NONE; | ||
298 | *out_hwirq = *intspec; | ||
299 | return 0; | ||
300 | } | ||
301 | |||
302 | static const struct irq_domain_ops pmac_pic_host_ops = { | 291 | static const struct irq_domain_ops pmac_pic_host_ops = { |
303 | .match = pmac_pic_host_match, | 292 | .match = pmac_pic_host_match, |
304 | .map = pmac_pic_host_map, | 293 | .map = pmac_pic_host_map, |
305 | .xlate = pmac_pic_host_xlate, | 294 | .xlate = irq_domain_xlate_onecell, |
306 | }; | 295 | }; |
307 | 296 | ||
308 | static void __init pmac_pic_probe_oldstyle(void) | 297 | static void __init pmac_pic_probe_oldstyle(void) |
diff --git a/arch/powerpc/platforms/wsp/opb_pic.c b/arch/powerpc/platforms/wsp/opb_pic.c index 0c6fe0b50137..cb565bf93650 100644 --- a/arch/powerpc/platforms/wsp/opb_pic.c +++ b/arch/powerpc/platforms/wsp/opb_pic.c | |||
@@ -196,20 +196,9 @@ static int opb_host_map(struct irq_domain *host, unsigned int virq, | |||
196 | return 0; | 196 | return 0; |
197 | } | 197 | } |
198 | 198 | ||
199 | static int opb_host_xlate(struct irq_domain *host, struct device_node *dn, | ||
200 | const u32 *intspec, unsigned int intsize, | ||
201 | irq_hw_number_t *out_hwirq, unsigned int *out_type) | ||
202 | { | ||
203 | /* Interrupt size must == 2 */ | ||
204 | BUG_ON(intsize != 2); | ||
205 | *out_hwirq = intspec[0]; | ||
206 | *out_type = intspec[1]; | ||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static const struct irq_domain_ops opb_host_ops = { | 199 | static const struct irq_domain_ops opb_host_ops = { |
211 | .map = opb_host_map, | 200 | .map = opb_host_map, |
212 | .xlate = opb_host_xlate, | 201 | .xlate = irq_domain_xlate_twocell, |
213 | }; | 202 | }; |
214 | 203 | ||
215 | irqreturn_t opb_irq_handler(int irq, void *private) | 204 | irqreturn_t opb_irq_handler(int irq, void *private) |
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index 8c9fc9c29095..d3be961e2ae7 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c | |||
@@ -224,21 +224,9 @@ static int cpm2_pic_host_map(struct irq_domain *h, unsigned int virq, | |||
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | static int cpm2_pic_host_xlate(struct irq_domain *h, struct device_node *ct, | ||
228 | const u32 *intspec, unsigned int intsize, | ||
229 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | ||
230 | { | ||
231 | *out_hwirq = intspec[0]; | ||
232 | if (intsize > 1) | ||
233 | *out_flags = intspec[1]; | ||
234 | else | ||
235 | *out_flags = IRQ_TYPE_NONE; | ||
236 | return 0; | ||
237 | } | ||
238 | |||
239 | static const struct irq_domain_ops cpm2_pic_host_ops = { | 227 | static const struct irq_domain_ops cpm2_pic_host_ops = { |
240 | .map = cpm2_pic_host_map, | 228 | .map = cpm2_pic_host_map, |
241 | .xlate = cpm2_pic_host_xlate, | 229 | .xlate = irq_domain_xlate_onetwocell, |
242 | }; | 230 | }; |
243 | 231 | ||
244 | void cpm2_pic_init(struct device_node *node) | 232 | void cpm2_pic_init(struct device_node *node) |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 0eaaa01c11b3..b50f97811c25 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -692,26 +692,10 @@ static int ipic_host_map(struct irq_domain *h, unsigned int virq, | |||
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
694 | 694 | ||
695 | static int ipic_host_xlate(struct irq_domain *h, struct device_node *ct, | ||
696 | const u32 *intspec, unsigned int intsize, | ||
697 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | ||
698 | |||
699 | { | ||
700 | /* interrupt sense values coming from the device tree equal either | ||
701 | * LEVEL_LOW (low assertion) or EDGE_FALLING (high-to-low change) | ||
702 | */ | ||
703 | *out_hwirq = intspec[0]; | ||
704 | if (intsize > 1) | ||
705 | *out_flags = intspec[1]; | ||
706 | else | ||
707 | *out_flags = IRQ_TYPE_NONE; | ||
708 | return 0; | ||
709 | } | ||
710 | |||
711 | static struct irq_domain_ops ipic_host_ops = { | 695 | static struct irq_domain_ops ipic_host_ops = { |
712 | .match = ipic_host_match, | 696 | .match = ipic_host_match, |
713 | .map = ipic_host_map, | 697 | .map = ipic_host_map, |
714 | .xlate = ipic_host_xlate, | 698 | .xlate = irq_domain_xlate_onetwocell, |
715 | }; | 699 | }; |
716 | 700 | ||
717 | struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | 701 | struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index e9b3d5cc65d3..2fba6ef2f95e 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -272,23 +272,10 @@ static int qe_ic_host_map(struct irq_domain *h, unsigned int virq, | |||
272 | return 0; | 272 | return 0; |
273 | } | 273 | } |
274 | 274 | ||
275 | static int qe_ic_host_xlate(struct irq_domain *h, struct device_node *ct, | ||
276 | const u32 * intspec, unsigned int intsize, | ||
277 | irq_hw_number_t * out_hwirq, | ||
278 | unsigned int *out_flags) | ||
279 | { | ||
280 | *out_hwirq = intspec[0]; | ||
281 | if (intsize > 1) | ||
282 | *out_flags = intspec[1]; | ||
283 | else | ||
284 | *out_flags = IRQ_TYPE_NONE; | ||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | static struct irq_domain_ops qe_ic_host_ops = { | 275 | static struct irq_domain_ops qe_ic_host_ops = { |
289 | .match = qe_ic_host_match, | 276 | .match = qe_ic_host_match, |
290 | .map = qe_ic_host_map, | 277 | .map = qe_ic_host_map, |
291 | .xlate = qe_ic_host_xlate, | 278 | .xlate = irq_domain_xlate_onetwocell, |
292 | }; | 279 | }; |
293 | 280 | ||
294 | /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ | 281 | /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ |
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 84e59c97391f..92033936a8f7 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -190,21 +190,9 @@ static int uic_host_map(struct irq_domain *h, unsigned int virq, | |||
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
192 | 192 | ||
193 | static int uic_host_xlate(struct irq_domain *h, struct device_node *ct, | ||
194 | const u32 *intspec, unsigned int intsize, | ||
195 | irq_hw_number_t *out_hwirq, unsigned int *out_type) | ||
196 | |||
197 | { | ||
198 | /* UIC intspecs must have 2 cells */ | ||
199 | BUG_ON(intsize != 2); | ||
200 | *out_hwirq = intspec[0]; | ||
201 | *out_type = intspec[1]; | ||
202 | return 0; | ||
203 | } | ||
204 | |||
205 | static struct irq_domain_ops uic_host_ops = { | 193 | static struct irq_domain_ops uic_host_ops = { |
206 | .map = uic_host_map, | 194 | .map = uic_host_map, |
207 | .xlate = uic_host_xlate, | 195 | .xlate = irq_domain_xlate_twocell, |
208 | }; | 196 | }; |
209 | 197 | ||
210 | void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) | 198 | void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) |