diff options
author | Rob Herring <rob.herring@calxeda.com> | 2011-09-20 16:13:50 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 09:03:22 -0400 |
commit | c71a54b0820179e53483d5220cdef1a0df8d5bd1 (patch) | |
tree | 844e32441d70118f616d4b4c84b510aaec2e5dc1 /include/linux/of_irq.h | |
parent | 3a8254364277fabe01bc0e12b9691722939f5ef3 (diff) |
of/irq: introduce of_irq_init
of_irq_init will scan the devicetree for matching interrupt controller
nodes. Then it calls an initialization function for each found controller
in the proper order with parent nodes initialized before child nodes.
Based on initial pseudo code from Grant Likely.
Changes in v4:
- Drop unnecessary empty list check
- Be more verbose on errors
- Simplify "if (!desc) WARN_ON(1)" to "if (WARN_ON(!desc))"
Changes in v3:
- add missing kfree's found by Jamie
- Implement Grant's comments to simplify the init loop
- fix function comments
Changes in v2:
- Complete re-write of list searching code from Grant Likely
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/of_irq.h')
-rw-r--r-- | include/linux/of_irq.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index cd2e61ce4e83..d0307eed20c9 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -33,6 +33,8 @@ struct of_irq { | |||
33 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | 33 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ |
34 | }; | 34 | }; |
35 | 35 | ||
36 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | ||
37 | |||
36 | /* | 38 | /* |
37 | * Workarounds only applied to 32bit powermac machines | 39 | * Workarounds only applied to 32bit powermac machines |
38 | */ | 40 | */ |
@@ -73,6 +75,7 @@ extern int of_irq_to_resource_table(struct device_node *dev, | |||
73 | struct resource *res, int nr_irqs); | 75 | struct resource *res, int nr_irqs); |
74 | extern struct device_node *of_irq_find_parent(struct device_node *child); | 76 | extern struct device_node *of_irq_find_parent(struct device_node *child); |
75 | 77 | ||
78 | extern void of_irq_init(const struct of_device_id *matches); | ||
76 | 79 | ||
77 | #endif /* CONFIG_OF_IRQ */ | 80 | #endif /* CONFIG_OF_IRQ */ |
78 | #endif /* CONFIG_OF */ | 81 | #endif /* CONFIG_OF */ |