sh: intc: Implement reverse mapping for IRQs to per-controller IDs.

This implements a scheme roughly analogous to the PowerPC virtual to
hardware IRQ mapping, which we use for IRQ to per-controller ID mapping.
This makes it possible for drivers to use the IDs directly for lookup
instead of hardcoding the vector.

The main motivation for this work is as a building block for dynamically
allocating virtual IRQs for demuxing INTC events sharing a single INTEVT
in addition to a common masking source.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index bff2f28..d40fd77 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -108,6 +108,7 @@
 int __init register_intc_controller(struct intc_desc *desc);
 void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs);
 int intc_set_priority(unsigned int irq, unsigned int prio);
+unsigned int intc_irq_lookup(const char *chipname, intc_enum enum_id);
 
 #ifdef CONFIG_INTC_USERIMASK
 int register_intc_userimask(unsigned long addr);