aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-06-17 18:17:04 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-07-11 11:15:37 -0400
commit98aa468e045a0091a7c34d9f5205a629634fabf4 (patch)
treea08da590d80462c302750640eb88ec6c72859e1b /include
parent2a71a1a9da40dfbd5b23d4312aa1641385581f4a (diff)
irqdomain: Support for static IRQ mapping and association.
This adds a new strict mapping API for supporting creation of linux IRQs at existing positions within the domain. The new routines are as follows: For dynamic allocation and insertion to specified ranges: - irq_create_identity_mapping() - irq_create_strict_mappings() These will allocate and associate a range of linux IRQs at the specified location. This can be used by controllers that have their own static linux IRQ definitions to map a hwirq range to, as well as for platforms that wish to establish 1:1 identity mapping between linux and hwirq space. For insertion to specified ranges by platforms that do their own irq_desc management: - irq_domain_associate() - irq_domain_associate_many() These in turn call back in to the domain's ->map() routine, for further processing by the platform. Disassociation of IRQs get handled through irq_dispose_mapping() as normal. With these in place it should be possible to begin migration of legacy IRQ domains to linear ones, without requiring special handling for static vs dynamic IRQ definitions in DT vs non-DT paths. This also makes it possible for domains with static mappings to adopt whichever tree model best fits their needs, rather than simply restricting them to linear revmaps. Signed-off-by: Paul Mundt <lethal@linux-sh.org> [grant.likely: Reorganized irq_domain_associate{,_many} to have all logic in one place] [grant.likely: Add error checking for unallocated irq_descs at associate time] Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/irqdomain.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 17b60be30fff..eab8a0e60b8e 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -149,12 +149,31 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
149 149
150extern void irq_domain_remove(struct irq_domain *host); 150extern void irq_domain_remove(struct irq_domain *host);
151 151
152extern int irq_domain_associate_many(struct irq_domain *domain,
153 unsigned int irq_base,
154 irq_hw_number_t hwirq_base, int count);
155static inline int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
156 irq_hw_number_t hwirq)
157{
158 return irq_domain_associate_many(domain, irq, hwirq, 1);
159}
160
152extern unsigned int irq_create_mapping(struct irq_domain *host, 161extern unsigned int irq_create_mapping(struct irq_domain *host,
153 irq_hw_number_t hwirq); 162 irq_hw_number_t hwirq);
154extern void irq_dispose_mapping(unsigned int virq); 163extern void irq_dispose_mapping(unsigned int virq);
155extern unsigned int irq_find_mapping(struct irq_domain *host, 164extern unsigned int irq_find_mapping(struct irq_domain *host,
156 irq_hw_number_t hwirq); 165 irq_hw_number_t hwirq);
157extern unsigned int irq_create_direct_mapping(struct irq_domain *host); 166extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
167extern int irq_create_strict_mappings(struct irq_domain *domain,
168 unsigned int irq_base,
169 irq_hw_number_t hwirq_base, int count);
170
171static inline int irq_create_identity_mapping(struct irq_domain *host,
172 irq_hw_number_t hwirq)
173{
174 return irq_create_strict_mappings(host, hwirq, hwirq, 1);
175}
176
158extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, 177extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq,
159 irq_hw_number_t hwirq); 178 irq_hw_number_t hwirq);
160extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host, 179extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host,