diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2015-01-14 20:30:58 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-01-29 10:24:47 -0500 |
commit | 590f2661069823cb14c6ca695a71b85e591d12a6 (patch) | |
tree | 0fe09383709ecfab81dc22c42c987c7f0d3848aa /arch/arm | |
parent | 83508093f448e929bf55d07dd08246d22b03d753 (diff) |
ARM: 8279/1: sa1100: merge both GPIO irqdomains
Now there is no difference between low and high GPIO irqdomains. Merge
them into single irqdomain handling all GPIOs.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-sa1100/irq.c | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index 2dc6a2a9c60c..5589b23ed043 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c | |||
@@ -154,10 +154,10 @@ static int sa1100_gpio_wake(struct irq_data *d, unsigned int on) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | /* | 156 | /* |
157 | * This is for IRQs from 0 to 10. | 157 | * This is for GPIO IRQs |
158 | */ | 158 | */ |
159 | static struct irq_chip sa1100_low_gpio_chip = { | 159 | static struct irq_chip sa1100_gpio_chip = { |
160 | .name = "GPIO-l", | 160 | .name = "GPIO", |
161 | .irq_ack = sa1100_gpio_ack, | 161 | .irq_ack = sa1100_gpio_ack, |
162 | .irq_mask = sa1100_gpio_mask, | 162 | .irq_mask = sa1100_gpio_mask, |
163 | .irq_unmask = sa1100_gpio_unmask, | 163 | .irq_unmask = sa1100_gpio_unmask, |
@@ -165,22 +165,22 @@ static struct irq_chip sa1100_low_gpio_chip = { | |||
165 | .irq_set_wake = sa1100_gpio_wake, | 165 | .irq_set_wake = sa1100_gpio_wake, |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static int sa1100_low_gpio_irqdomain_map(struct irq_domain *d, | 168 | static int sa1100_gpio_irqdomain_map(struct irq_domain *d, |
169 | unsigned int irq, irq_hw_number_t hwirq) | 169 | unsigned int irq, irq_hw_number_t hwirq) |
170 | { | 170 | { |
171 | irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, | 171 | irq_set_chip_and_handler(irq, &sa1100_gpio_chip, |
172 | handle_edge_irq); | 172 | handle_edge_irq); |
173 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 173 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
174 | 174 | ||
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | static struct irq_domain_ops sa1100_low_gpio_irqdomain_ops = { | 178 | static struct irq_domain_ops sa1100_gpio_irqdomain_ops = { |
179 | .map = sa1100_low_gpio_irqdomain_map, | 179 | .map = sa1100_gpio_irqdomain_map, |
180 | .xlate = irq_domain_xlate_onetwocell, | 180 | .xlate = irq_domain_xlate_onetwocell, |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static struct irq_domain *sa1100_low_gpio_irqdomain; | 183 | static struct irq_domain *sa1100_gpio_irqdomain; |
184 | 184 | ||
185 | /* | 185 | /* |
186 | * IRQ 0-11 (GPIO) handler. We enter here with the | 186 | * IRQ 0-11 (GPIO) handler. We enter here with the |
@@ -212,37 +212,6 @@ sa1100_gpio_handler(unsigned int irq, struct irq_desc *desc) | |||
212 | } while (mask); | 212 | } while (mask); |
213 | } | 213 | } |
214 | 214 | ||
215 | /* | ||
216 | * Like GPIO0 to 10, GPIO11-27 IRQs need to be handled specially. | ||
217 | * In addition, the IRQs are all collected up into one bit in the | ||
218 | * interrupt controller registers. | ||
219 | */ | ||
220 | static struct irq_chip sa1100_high_gpio_chip = { | ||
221 | .name = "GPIO-h", | ||
222 | .irq_ack = sa1100_gpio_ack, | ||
223 | .irq_mask = sa1100_gpio_mask, | ||
224 | .irq_unmask = sa1100_gpio_unmask, | ||
225 | .irq_set_type = sa1100_gpio_type, | ||
226 | .irq_set_wake = sa1100_gpio_wake, | ||
227 | }; | ||
228 | |||
229 | static int sa1100_high_gpio_irqdomain_map(struct irq_domain *d, | ||
230 | unsigned int irq, irq_hw_number_t hwirq) | ||
231 | { | ||
232 | irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, | ||
233 | handle_edge_irq); | ||
234 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
235 | |||
236 | return 0; | ||
237 | } | ||
238 | |||
239 | static struct irq_domain_ops sa1100_high_gpio_irqdomain_ops = { | ||
240 | .map = sa1100_high_gpio_irqdomain_map, | ||
241 | .xlate = irq_domain_xlate_onetwocell, | ||
242 | }; | ||
243 | |||
244 | static struct irq_domain *sa1100_high_gpio_irqdomain; | ||
245 | |||
246 | static struct resource irq_resource = | 215 | static struct resource irq_resource = |
247 | DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); | 216 | DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); |
248 | 217 | ||
@@ -353,13 +322,9 @@ void __init sa1100_init_irq(void) | |||
353 | 32, IRQ_GPIO0_SC, 0, | 322 | 32, IRQ_GPIO0_SC, 0, |
354 | &sa1100_normal_irqdomain_ops, NULL); | 323 | &sa1100_normal_irqdomain_ops, NULL); |
355 | 324 | ||
356 | sa1100_low_gpio_irqdomain = irq_domain_add_legacy(NULL, | 325 | sa1100_gpio_irqdomain = irq_domain_add_legacy(NULL, |
357 | 11, IRQ_GPIO0, 0, | 326 | 28, IRQ_GPIO0, 0, |
358 | &sa1100_low_gpio_irqdomain_ops, NULL); | 327 | &sa1100_gpio_irqdomain_ops, NULL); |
359 | |||
360 | sa1100_high_gpio_irqdomain = irq_domain_add_legacy(NULL, | ||
361 | 17, IRQ_GPIO11, 11, | ||
362 | &sa1100_high_gpio_irqdomain_ops, NULL); | ||
363 | 328 | ||
364 | /* | 329 | /* |
365 | * Install handlers for GPIO 0-10 edge detect interrupts | 330 | * Install handlers for GPIO 0-10 edge detect interrupts |