aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 23:44:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 23:44:03 -0400
commit2d534926205db9ffce4bbbde67cb9b2cee4b835c (patch)
treeb906e41009b54d9a286df3454a841fd2b3f170cc /include
parentac694dbdbc403c00e2c14d10bc7b8412cc378259 (diff)
parentf5a1ad057e6da5d0fc9c5677ff44797d193d3e62 (diff)
Merge tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6
Pull irqdomain changes from Grant Likely: "Round of refactoring and enhancements to irq_domain infrastructure. This series starts the process of simplifying irqdomain. The ultimate goal is to merge LEGACY, LINEAR and TREE mappings into a single system, but had to back off from that after some last minute bugs. Instead it mainly reorganizes the code and ensures that the reverse map gets populated when the irq is mapped instead of the first time it is looked up. Merging of the irq_domain types is deferred to v3.7 In other news, this series adds helpers for creating static mappings on a linear or tree mapping." * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6: irqdomain: Improve diagnostics when a domain mapping fails irqdomain: eliminate slow-path revmap lookups irqdomain: Fix irq_create_direct_mapping() to test irq_domain type. irqdomain: Eliminate dedicated radix lookup functions irqdomain: Support for static IRQ mapping and association. irqdomain: Always update revmap when setting up a virq irqdomain: Split disassociating code into separate function irq_domain: correct a minor wrong comment for linear revmap irq_domain: Standardise legacy/linear domain selection irqdomain: Make ops->map hook optional irqdomain: Remove unnecessary test for IRQ_DOMAIN_MAP_LEGACY irqdomain: Simple NUMA awareness. devicetree: add helper inline for retrieving a node's full name
Diffstat (limited to 'include')
-rw-r--r--include/linux/irqdomain.h28
-rw-r--r--include/linux/of.h15
2 files changed, 34 insertions, 9 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 5abb533eb8eb..0d5b17bf5e51 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -112,6 +112,11 @@ struct irq_domain {
112}; 112};
113 113
114#ifdef CONFIG_IRQ_DOMAIN 114#ifdef CONFIG_IRQ_DOMAIN
115struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
116 unsigned int size,
117 unsigned int first_irq,
118 const struct irq_domain_ops *ops,
119 void *host_data);
115struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, 120struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
116 unsigned int size, 121 unsigned int size,
117 unsigned int first_irq, 122 unsigned int first_irq,
@@ -144,16 +149,31 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
144 149
145extern void irq_domain_remove(struct irq_domain *host); 150extern void irq_domain_remove(struct irq_domain *host);
146 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
147extern unsigned int irq_create_mapping(struct irq_domain *host, 161extern unsigned int irq_create_mapping(struct irq_domain *host,
148 irq_hw_number_t hwirq); 162 irq_hw_number_t hwirq);
149extern void irq_dispose_mapping(unsigned int virq); 163extern void irq_dispose_mapping(unsigned int virq);
150extern unsigned int irq_find_mapping(struct irq_domain *host, 164extern unsigned int irq_find_mapping(struct irq_domain *host,
151 irq_hw_number_t hwirq); 165 irq_hw_number_t hwirq);
152extern unsigned int irq_create_direct_mapping(struct irq_domain *host); 166extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
153extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, 167extern int irq_create_strict_mappings(struct irq_domain *domain,
154 irq_hw_number_t hwirq); 168 unsigned int irq_base,
155extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host, 169 irq_hw_number_t hwirq_base, int count);
156 irq_hw_number_t hwirq); 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
157extern unsigned int irq_linear_revmap(struct irq_domain *host, 177extern unsigned int irq_linear_revmap(struct irq_domain *host,
158 irq_hw_number_t hwirq); 178 irq_hw_number_t hwirq);
159 179
diff --git a/include/linux/of.h b/include/linux/of.h
index 42c2a58328c1..5919ee33f2b7 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -21,6 +21,7 @@
21#include <linux/kref.h> 21#include <linux/kref.h>
22#include <linux/mod_devicetable.h> 22#include <linux/mod_devicetable.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/topology.h>
24 25
25#include <asm/byteorder.h> 26#include <asm/byteorder.h>
26#include <asm/errno.h> 27#include <asm/errno.h>
@@ -158,11 +159,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
158 159
159#define OF_BAD_ADDR ((u64)-1) 160#define OF_BAD_ADDR ((u64)-1)
160 161
161#ifndef of_node_to_nid
162static inline int of_node_to_nid(struct device_node *np) { return -1; }
163#define of_node_to_nid of_node_to_nid
164#endif
165
166static inline const char* of_node_full_name(struct device_node *np) 162static inline const char* of_node_full_name(struct device_node *np)
167{ 163{
168 return np ? np->full_name : "<no-node>"; 164 return np ? np->full_name : "<no-node>";
@@ -427,6 +423,15 @@ static inline int of_machine_is_compatible(const char *compat)
427 while (0) 423 while (0)
428#endif /* CONFIG_OF */ 424#endif /* CONFIG_OF */
429 425
426#ifndef of_node_to_nid
427static inline int of_node_to_nid(struct device_node *np)
428{
429 return numa_node_id();
430}
431
432#define of_node_to_nid of_node_to_nid
433#endif
434
430/** 435/**
431 * of_property_read_bool - Findfrom a property 436 * of_property_read_bool - Findfrom a property
432 * @np: device node from which the property value is to be read. 437 * @np: device node from which the property value is to be read.