diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/irqdomain.h | 28 | ||||
| -rw-r--r-- | include/linux/of.h | 15 |
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 |
| 115 | struct 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); | ||
| 115 | struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, | 120 | struct 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 | ||
| 145 | extern void irq_domain_remove(struct irq_domain *host); | 150 | extern void irq_domain_remove(struct irq_domain *host); |
| 146 | 151 | ||
| 152 | extern int irq_domain_associate_many(struct irq_domain *domain, | ||
| 153 | unsigned int irq_base, | ||
| 154 | irq_hw_number_t hwirq_base, int count); | ||
| 155 | static 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 | |||
| 147 | extern unsigned int irq_create_mapping(struct irq_domain *host, | 161 | extern unsigned int irq_create_mapping(struct irq_domain *host, |
| 148 | irq_hw_number_t hwirq); | 162 | irq_hw_number_t hwirq); |
| 149 | extern void irq_dispose_mapping(unsigned int virq); | 163 | extern void irq_dispose_mapping(unsigned int virq); |
| 150 | extern unsigned int irq_find_mapping(struct irq_domain *host, | 164 | extern unsigned int irq_find_mapping(struct irq_domain *host, |
| 151 | irq_hw_number_t hwirq); | 165 | irq_hw_number_t hwirq); |
| 152 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); | 166 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); |
| 153 | extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, | 167 | extern int irq_create_strict_mappings(struct irq_domain *domain, |
| 154 | irq_hw_number_t hwirq); | 168 | unsigned int irq_base, |
| 155 | extern 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 | |
| 171 | static 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 | |||
| 157 | extern unsigned int irq_linear_revmap(struct irq_domain *host, | 177 | extern 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 | ||
| 162 | static 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 | |||
| 166 | static inline const char* of_node_full_name(struct device_node *np) | 162 | static 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 | ||
| 427 | static 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. |
