diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 03:37:49 -0500 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 03:37:49 -0500 |
| commit | cc79ca691c292e9fd44f589c7940b9654e22f2f6 (patch) | |
| tree | 4efe01e4f4a92f97dba326923e0a7a8af4b3bf87 /include/linux | |
| parent | 6d9285b00f776eebe459a858ebf07b56c36c60d2 (diff) | |
irq_domain: Move irq_domain code from powerpc to kernel/irq
This patch only moves the code. It doesn't make any changes, and the
code is still only compiled for powerpc. Follow-on patches will generalize
the code for other architectures.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/irqdomain.h | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 35b9ff382e45..18f4ab002d2e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
| @@ -16,6 +16,17 @@ | |||
| 16 | * (though a domain can cover more than one PIC if they have a flat number | 16 | * (though a domain can cover more than one PIC if they have a flat number |
| 17 | * model). It's the domain callbacks that are responsible for setting the | 17 | * model). It's the domain callbacks that are responsible for setting the |
| 18 | * irq_chip on a given irq_desc after it's been mapped. | 18 | * irq_chip on a given irq_desc after it's been mapped. |
| 19 | * | ||
| 20 | * The host code and data structures are agnostic to whether or not | ||
| 21 | * we use an open firmware device-tree. We do have references to struct | ||
| 22 | * device_node in two places: in irq_find_host() to find the host matching | ||
| 23 | * a given interrupt controller node, and of course as an argument to its | ||
| 24 | * counterpart domain->ops->match() callback. However, those are treated as | ||
| 25 | * generic pointers by the core and the fact that it's actually a device-node | ||
| 26 | * pointer is purely a convention between callers and implementation. This | ||
| 27 | * code could thus be used on other architectures by replacing those two | ||
| 28 | * by some sort of arch-specific void * "token" used to identify interrupt | ||
| 29 | * controllers. | ||
| 19 | */ | 30 | */ |
| 20 | 31 | ||
| 21 | #ifndef _LINUX_IRQDOMAIN_H | 32 | #ifndef _LINUX_IRQDOMAIN_H |
| @@ -108,6 +119,32 @@ struct irq_domain { | |||
| 108 | }; | 119 | }; |
| 109 | 120 | ||
| 110 | #ifdef CONFIG_IRQ_DOMAIN | 121 | #ifdef CONFIG_IRQ_DOMAIN |
| 122 | #ifdef CONFIG_PPC | ||
| 123 | extern struct irq_domain *irq_alloc_host(struct device_node *of_node, | ||
| 124 | unsigned int revmap_type, | ||
| 125 | unsigned int revmap_arg, | ||
| 126 | struct irq_domain_ops *ops, | ||
| 127 | irq_hw_number_t inval_irq); | ||
| 128 | extern struct irq_domain *irq_find_host(struct device_node *node); | ||
| 129 | extern void irq_set_default_host(struct irq_domain *host); | ||
| 130 | extern void irq_set_virq_count(unsigned int count); | ||
| 131 | |||
| 132 | |||
| 133 | extern unsigned int irq_create_mapping(struct irq_domain *host, | ||
| 134 | irq_hw_number_t hwirq); | ||
| 135 | extern void irq_dispose_mapping(unsigned int virq); | ||
| 136 | extern unsigned int irq_find_mapping(struct irq_domain *host, | ||
| 137 | irq_hw_number_t hwirq); | ||
| 138 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); | ||
| 139 | extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, | ||
| 140 | irq_hw_number_t hwirq); | ||
| 141 | extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host, | ||
| 142 | irq_hw_number_t hwirq); | ||
| 143 | extern unsigned int irq_linear_revmap(struct irq_domain *host, | ||
| 144 | irq_hw_number_t hwirq); | ||
| 145 | |||
| 146 | #else /* CONFIG_PPC */ | ||
| 147 | |||
| 111 | /** | 148 | /** |
| 112 | * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number | 149 | * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number |
| 113 | * | 150 | * |
| @@ -137,15 +174,16 @@ extern void irq_domain_add(struct irq_domain *domain); | |||
| 137 | extern void irq_domain_del(struct irq_domain *domain); | 174 | extern void irq_domain_del(struct irq_domain *domain); |
| 138 | 175 | ||
| 139 | extern struct irq_domain_ops irq_domain_simple_ops; | 176 | extern struct irq_domain_ops irq_domain_simple_ops; |
| 140 | #endif /* CONFIG_IRQ_DOMAIN */ | ||
| 141 | 177 | ||
| 142 | #if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ) | 178 | #if defined(CONFIG_OF_IRQ) |
| 143 | extern void irq_domain_add_simple(struct device_node *controller, int irq_base); | 179 | extern void irq_domain_add_simple(struct device_node *controller, int irq_base); |
| 144 | extern void irq_domain_generate_simple(const struct of_device_id *match, | 180 | extern void irq_domain_generate_simple(const struct of_device_id *match, |
| 145 | u64 phys_base, unsigned int irq_start); | 181 | u64 phys_base, unsigned int irq_start); |
| 146 | #else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */ | 182 | #else /* CONFIG_OF_IRQ */ |
| 147 | static inline void irq_domain_generate_simple(const struct of_device_id *match, | 183 | static inline void irq_domain_generate_simple(const struct of_device_id *match, |
| 148 | u64 phys_base, unsigned int irq_start) { } | 184 | u64 phys_base, unsigned int irq_start) { } |
| 149 | #endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */ | 185 | #endif /* !CONFIG_OF_IRQ */ |
| 186 | #endif /* !CONFIG_PPC */ | ||
| 187 | #endif /* CONFIG_IRQ_DOMAIN */ | ||
| 150 | 188 | ||
| 151 | #endif /* _LINUX_IRQDOMAIN_H */ | 189 | #endif /* _LINUX_IRQDOMAIN_H */ |
