summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-08-01 17:14:52 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-08-01 17:14:52 +0900
commitf38770477a30d03b6296570071ca2fcd6d3a5f11 (patch)
tree3dd11460c4115d97137a6ff82683e593a3813607 /include
parent1ca8fe38a6c958babe6571e39cb0115a40b94603 (diff)
parent1d6a21b0a672fb29b01ccf397d478e0541e17716 (diff)
downloadlinux-f38770477a30d03b6296570071ca2fcd6d3a5f11.tar.bz2
Merge branch 'common/irqdomain' into sh-latest
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 {
};
#ifdef CONFIG_IRQ_DOMAIN
+struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
+ unsigned int size,
+ unsigned int first_irq,
+ const struct irq_domain_ops *ops,
+ void *host_data);
struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
unsigned int size,
unsigned int first_irq,
@@ -144,16 +149,31 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
extern void irq_domain_remove(struct irq_domain *host);
+extern int irq_domain_associate_many(struct irq_domain *domain,
+ unsigned int irq_base,
+ irq_hw_number_t hwirq_base, int count);
+static inline int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
+ irq_hw_number_t hwirq)
+{
+ return irq_domain_associate_many(domain, irq, hwirq, 1);
+}
+
extern unsigned int irq_create_mapping(struct irq_domain *host,
irq_hw_number_t hwirq);
extern void irq_dispose_mapping(unsigned int virq);
extern unsigned int irq_find_mapping(struct irq_domain *host,
irq_hw_number_t hwirq);
extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
-extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq,
- irq_hw_number_t hwirq);
-extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host,
- irq_hw_number_t hwirq);
+extern int irq_create_strict_mappings(struct irq_domain *domain,
+ unsigned int irq_base,
+ irq_hw_number_t hwirq_base, int count);
+
+static inline int irq_create_identity_mapping(struct irq_domain *host,
+ irq_hw_number_t hwirq)
+{
+ return irq_create_strict_mappings(host, hwirq, hwirq, 1);
+}
+
extern unsigned int irq_linear_revmap(struct irq_domain *host,
irq_hw_number_t hwirq);
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 @@
#include <linux/kref.h>
#include <linux/mod_devicetable.h>
#include <linux/spinlock.h>
+#include <linux/topology.h>
#include <asm/byteorder.h>
#include <asm/errno.h>
@@ -158,11 +159,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
#define OF_BAD_ADDR ((u64)-1)
-#ifndef of_node_to_nid
-static inline int of_node_to_nid(struct device_node *np) { return -1; }
-#define of_node_to_nid of_node_to_nid
-#endif
-
static inline const char* of_node_full_name(struct device_node *np)
{
return np ? np->full_name : "<no-node>";
@@ -427,6 +423,15 @@ static inline int of_machine_is_compatible(const char *compat)
while (0)
#endif /* CONFIG_OF */
+#ifndef of_node_to_nid
+static inline int of_node_to_nid(struct device_node *np)
+{
+ return numa_node_id();
+}
+
+#define of_node_to_nid of_node_to_nid
+#endif
+
/**
* of_property_read_bool - Findfrom a property
* @np: device node from which the property value is to be read.