From 7e71330169d8056536b299290544980bccc6b300 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Tue, 26 Jul 2011 03:19:06 -0600 Subject: 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 --- include/linux/irqdomain.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/irqdomain.h') 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 +#include #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 */ -- cgit