summaryrefslogtreecommitdiff
path: root/include/linux/irqdomain.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-07-26 03:19:06 -0600
committerGrant Likely <grant.likely@secretlab.ca>2011-07-28 01:32:04 -0600
commit7e71330169d8056536b299290544980bccc6b300 (patch)
tree7dab4954a7683e35bbf66adadd89b26971960311 /include/linux/irqdomain.h
parent08a543ad33fc188650801bd36eed4ffe272643e1 (diff)
dt/irq: add irq_domain_generate_simple() helper
irq_domain_generate_simple() is an easy way to generate an irq translation domain for simple irq controllers. It assumes a flat 1:1 mapping from hardware irq number to an offset of the first linux irq number assigned to the controller Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/irqdomain.h')
-rw-r--r--include/linux/irqdomain.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 8f2c10a784a4..e807ad687a07 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -16,6 +16,7 @@
#define _LINUX_IRQDOMAIN_H
#include <linux/irq.h>
+#include <linux/mod_devicetable.h>
#ifdef CONFIG_IRQ_DOMAIN
struct device_node;
@@ -78,4 +79,13 @@ extern void irq_domain_add(struct irq_domain *domain);
extern void irq_domain_del(struct irq_domain *domain);
#endif /* CONFIG_IRQ_DOMAIN */
+#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
+extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
+extern void irq_domain_generate_simple(const struct of_device_id *match,
+ u64 phys_base, unsigned int irq_start);
+#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
+static inline void irq_domain_generate_simple(const struct of_device_id *match,
+ u64 phys_base, unsigned int irq_start) { }
+#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
+
#endif /* _LINUX_IRQDOMAIN_H */