Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-sa1100/irq.c |
| 3 | * |
| 4 | * Copyright (C) 1999-2001 Nicolas Pitre |
| 5 | * |
| 6 | * Generic IRQ handling for the SA11x0, GPIO 11-27 IRQ demultiplexing. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/module.h> |
Thomas Gleixner | 119c641 | 2006-07-01 22:32:38 +0100 | [diff] [blame] | 14 | #include <linux/interrupt.h> |
Russell King | 3169663 | 2012-06-06 11:42:36 +0100 | [diff] [blame] | 15 | #include <linux/io.h> |
Thomas Gleixner | 119c641 | 2006-07-01 22:32:38 +0100 | [diff] [blame] | 16 | #include <linux/irq.h> |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 17 | #include <linux/irqdomain.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <linux/ioport.h> |
Rafael J. Wysocki | 9053398 | 2011-04-22 22:03:03 +0200 | [diff] [blame] | 19 | #include <linux/syscore_ops.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 21 | #include <mach/hardware.h> |
Rob Herring | f314f33 | 2012-02-24 00:06:51 +0100 | [diff] [blame] | 22 | #include <mach/irqs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | #include <asm/mach/irq.h> |
Dmitry Eremin-Solenikov | affcab3 | 2014-11-28 15:55:16 +0100 | [diff] [blame] | 24 | #include <asm/exception.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | #include "generic.h" |
| 27 | |
| 28 | |
| 29 | /* |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 30 | * We don't need to ACK IRQs on the SA1100 unless they're GPIOs |
| 31 | * this is for internal IRQs i.e. from IRQ LCD to RTCAlrm. |
| 32 | */ |
| 33 | static void sa1100_mask_irq(struct irq_data *d) |
| 34 | { |
| 35 | ICMR &= ~BIT(d->hwirq); |
| 36 | } |
| 37 | |
| 38 | static void sa1100_unmask_irq(struct irq_data *d) |
| 39 | { |
| 40 | ICMR |= BIT(d->hwirq); |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * Apart form GPIOs, only the RTC alarm can be a wakeup event. |
| 45 | */ |
| 46 | static int sa1100_set_wake(struct irq_data *d, unsigned int on) |
| 47 | { |
| 48 | if (BIT(d->hwirq) == IC_RTCAlrm) { |
| 49 | if (on) |
| 50 | PWER |= PWER_RTC; |
| 51 | else |
| 52 | PWER &= ~PWER_RTC; |
| 53 | return 0; |
| 54 | } |
| 55 | return -EINVAL; |
| 56 | } |
| 57 | |
| 58 | static struct irq_chip sa1100_normal_chip = { |
| 59 | .name = "SC", |
| 60 | .irq_ack = sa1100_mask_irq, |
| 61 | .irq_mask = sa1100_mask_irq, |
| 62 | .irq_unmask = sa1100_unmask_irq, |
| 63 | .irq_set_wake = sa1100_set_wake, |
| 64 | }; |
| 65 | |
| 66 | static int sa1100_normal_irqdomain_map(struct irq_domain *d, |
| 67 | unsigned int irq, irq_hw_number_t hwirq) |
| 68 | { |
| 69 | irq_set_chip_and_handler(irq, &sa1100_normal_chip, |
| 70 | handle_level_irq); |
| 71 | set_irq_flags(irq, IRQF_VALID); |
| 72 | |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | static struct irq_domain_ops sa1100_normal_irqdomain_ops = { |
| 77 | .map = sa1100_normal_irqdomain_map, |
| 78 | .xlate = irq_domain_xlate_onetwocell, |
| 79 | }; |
| 80 | |
| 81 | static struct irq_domain *sa1100_normal_irqdomain; |
| 82 | |
| 83 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | * SA1100 GPIO edge detection for IRQs: |
| 85 | * IRQs are generated on Falling-Edge, Rising-Edge, or both. |
| 86 | * Use this instead of directly setting GRER/GFER. |
| 87 | */ |
| 88 | static int GPIO_IRQ_rising_edge; |
| 89 | static int GPIO_IRQ_falling_edge; |
| 90 | static int GPIO_IRQ_mask = (1 << 11) - 1; |
| 91 | |
Lennert Buytenhek | c4e8964 | 2010-11-29 11:12:06 +0100 | [diff] [blame] | 92 | static int sa1100_gpio_type(struct irq_data *d, unsigned int type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | { |
| 94 | unsigned int mask; |
| 95 | |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 96 | mask = BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | |
Dmitry Baryshkov | 6cab486 | 2008-07-27 04:23:31 +0100 | [diff] [blame] | 98 | if (type == IRQ_TYPE_PROBE) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) |
| 100 | return 0; |
Dmitry Baryshkov | 6cab486 | 2008-07-27 04:23:31 +0100 | [diff] [blame] | 101 | type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Dmitry Baryshkov | 6cab486 | 2008-07-27 04:23:31 +0100 | [diff] [blame] | 104 | if (type & IRQ_TYPE_EDGE_RISING) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | GPIO_IRQ_rising_edge |= mask; |
| 106 | } else |
| 107 | GPIO_IRQ_rising_edge &= ~mask; |
Dmitry Baryshkov | 6cab486 | 2008-07-27 04:23:31 +0100 | [diff] [blame] | 108 | if (type & IRQ_TYPE_EDGE_FALLING) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | GPIO_IRQ_falling_edge |= mask; |
| 110 | } else |
| 111 | GPIO_IRQ_falling_edge &= ~mask; |
| 112 | |
| 113 | GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask; |
| 114 | GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; |
| 115 | |
| 116 | return 0; |
| 117 | } |
| 118 | |
| 119 | /* |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 120 | * GPIO IRQs must be acknowledged. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | */ |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 122 | static void sa1100_gpio_ack(struct irq_data *d) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | { |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 124 | GEDR = BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 127 | static int sa1100_gpio_wake(struct irq_data *d, unsigned int on) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | { |
| 129 | if (on) |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 130 | PWER |= BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | else |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 132 | PWER &= ~BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | return 0; |
| 134 | } |
| 135 | |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 136 | /* |
| 137 | * This is for IRQs from 0 to 10. |
| 138 | */ |
David Brownell | 38c677c | 2006-08-01 22:26:25 +0100 | [diff] [blame] | 139 | static struct irq_chip sa1100_low_gpio_chip = { |
| 140 | .name = "GPIO-l", |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 141 | .irq_ack = sa1100_gpio_ack, |
| 142 | .irq_mask = sa1100_mask_irq, |
| 143 | .irq_unmask = sa1100_unmask_irq, |
Lennert Buytenhek | c4e8964 | 2010-11-29 11:12:06 +0100 | [diff] [blame] | 144 | .irq_set_type = sa1100_gpio_type, |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 145 | .irq_set_wake = sa1100_gpio_wake, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | }; |
| 147 | |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 148 | static int sa1100_low_gpio_irqdomain_map(struct irq_domain *d, |
| 149 | unsigned int irq, irq_hw_number_t hwirq) |
| 150 | { |
| 151 | irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, |
| 152 | handle_edge_irq); |
| 153 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
| 154 | |
| 155 | return 0; |
| 156 | } |
| 157 | |
| 158 | static struct irq_domain_ops sa1100_low_gpio_irqdomain_ops = { |
| 159 | .map = sa1100_low_gpio_irqdomain_map, |
| 160 | .xlate = irq_domain_xlate_onetwocell, |
| 161 | }; |
| 162 | |
| 163 | static struct irq_domain *sa1100_low_gpio_irqdomain; |
| 164 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | /* |
| 166 | * IRQ11 (GPIO11 through 27) handler. We enter here with the |
| 167 | * irq_controller_lock held, and IRQs disabled. Decode the IRQ |
| 168 | * and call the handler. |
| 169 | */ |
| 170 | static void |
Russell King | 10dd5ce | 2006-11-23 11:41:32 +0000 | [diff] [blame] | 171 | sa1100_high_gpio_handler(unsigned int irq, struct irq_desc *desc) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | { |
| 173 | unsigned int mask; |
| 174 | |
| 175 | mask = GEDR & 0xfffff800; |
| 176 | do { |
| 177 | /* |
| 178 | * clear down all currently active IRQ sources. |
| 179 | * We will be processing them all. |
| 180 | */ |
| 181 | GEDR = mask; |
| 182 | |
| 183 | irq = IRQ_GPIO11; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | mask >>= 11; |
| 185 | do { |
| 186 | if (mask & 1) |
Dmitry Baryshkov | d8aa025 | 2008-10-09 13:36:24 +0100 | [diff] [blame] | 187 | generic_handle_irq(irq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | mask >>= 1; |
| 189 | irq++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | } while (mask); |
| 191 | |
| 192 | mask = GEDR & 0xfffff800; |
| 193 | } while (mask); |
| 194 | } |
| 195 | |
| 196 | /* |
| 197 | * Like GPIO0 to 10, GPIO11-27 IRQs need to be handled specially. |
| 198 | * In addition, the IRQs are all collected up into one bit in the |
| 199 | * interrupt controller registers. |
| 200 | */ |
Lennert Buytenhek | c4e8964 | 2010-11-29 11:12:06 +0100 | [diff] [blame] | 201 | static void sa1100_high_gpio_mask(struct irq_data *d) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | { |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 203 | unsigned int mask = BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | |
| 205 | GPIO_IRQ_mask &= ~mask; |
| 206 | |
| 207 | GRER &= ~mask; |
| 208 | GFER &= ~mask; |
| 209 | } |
| 210 | |
Lennert Buytenhek | c4e8964 | 2010-11-29 11:12:06 +0100 | [diff] [blame] | 211 | static void sa1100_high_gpio_unmask(struct irq_data *d) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | { |
Dmitry Eremin-Solenikov | 1eeec6a | 2014-11-28 15:57:32 +0100 | [diff] [blame] | 213 | unsigned int mask = BIT(d->hwirq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | |
| 215 | GPIO_IRQ_mask |= mask; |
| 216 | |
| 217 | GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask; |
| 218 | GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; |
| 219 | } |
| 220 | |
David Brownell | 38c677c | 2006-08-01 22:26:25 +0100 | [diff] [blame] | 221 | static struct irq_chip sa1100_high_gpio_chip = { |
| 222 | .name = "GPIO-h", |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 223 | .irq_ack = sa1100_gpio_ack, |
Lennert Buytenhek | c4e8964 | 2010-11-29 11:12:06 +0100 | [diff] [blame] | 224 | .irq_mask = sa1100_high_gpio_mask, |
| 225 | .irq_unmask = sa1100_high_gpio_unmask, |
| 226 | .irq_set_type = sa1100_gpio_type, |
Dmitry Eremin-Solenikov | ab71f99 | 2014-11-28 15:57:52 +0100 | [diff] [blame^] | 227 | .irq_set_wake = sa1100_gpio_wake, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 230 | static int sa1100_high_gpio_irqdomain_map(struct irq_domain *d, |
| 231 | unsigned int irq, irq_hw_number_t hwirq) |
| 232 | { |
| 233 | irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, |
| 234 | handle_edge_irq); |
| 235 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
| 236 | |
| 237 | return 0; |
| 238 | } |
| 239 | |
| 240 | static struct irq_domain_ops sa1100_high_gpio_irqdomain_ops = { |
| 241 | .map = sa1100_high_gpio_irqdomain_map, |
| 242 | .xlate = irq_domain_xlate_onetwocell, |
| 243 | }; |
| 244 | |
| 245 | static struct irq_domain *sa1100_high_gpio_irqdomain; |
| 246 | |
Russell King | a181099 | 2012-01-12 10:25:29 +0000 | [diff] [blame] | 247 | static struct resource irq_resource = |
| 248 | DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | |
| 250 | static struct sa1100irq_state { |
| 251 | unsigned int saved; |
| 252 | unsigned int icmr; |
| 253 | unsigned int iclr; |
| 254 | unsigned int iccr; |
| 255 | } sa1100irq_state; |
| 256 | |
Rafael J. Wysocki | 9053398 | 2011-04-22 22:03:03 +0200 | [diff] [blame] | 257 | static int sa1100irq_suspend(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | { |
| 259 | struct sa1100irq_state *st = &sa1100irq_state; |
| 260 | |
| 261 | st->saved = 1; |
| 262 | st->icmr = ICMR; |
| 263 | st->iclr = ICLR; |
| 264 | st->iccr = ICCR; |
| 265 | |
| 266 | /* |
| 267 | * Disable all GPIO-based interrupts. |
| 268 | */ |
| 269 | ICMR &= ~(IC_GPIO11_27|IC_GPIO10|IC_GPIO9|IC_GPIO8|IC_GPIO7| |
| 270 | IC_GPIO6|IC_GPIO5|IC_GPIO4|IC_GPIO3|IC_GPIO2| |
| 271 | IC_GPIO1|IC_GPIO0); |
| 272 | |
| 273 | /* |
| 274 | * Set the appropriate edges for wakeup. |
| 275 | */ |
| 276 | GRER = PWER & GPIO_IRQ_rising_edge; |
| 277 | GFER = PWER & GPIO_IRQ_falling_edge; |
| 278 | |
| 279 | /* |
| 280 | * Clear any pending GPIO interrupts. |
| 281 | */ |
| 282 | GEDR = GEDR; |
| 283 | |
| 284 | return 0; |
| 285 | } |
| 286 | |
Rafael J. Wysocki | 9053398 | 2011-04-22 22:03:03 +0200 | [diff] [blame] | 287 | static void sa1100irq_resume(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | { |
| 289 | struct sa1100irq_state *st = &sa1100irq_state; |
| 290 | |
| 291 | if (st->saved) { |
| 292 | ICCR = st->iccr; |
| 293 | ICLR = st->iclr; |
| 294 | |
| 295 | GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask; |
| 296 | GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; |
| 297 | |
| 298 | ICMR = st->icmr; |
| 299 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | } |
| 301 | |
Rafael J. Wysocki | 9053398 | 2011-04-22 22:03:03 +0200 | [diff] [blame] | 302 | static struct syscore_ops sa1100irq_syscore_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | .suspend = sa1100irq_suspend, |
| 304 | .resume = sa1100irq_resume, |
| 305 | }; |
| 306 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | static int __init sa1100irq_init_devicefs(void) |
| 308 | { |
Rafael J. Wysocki | 9053398 | 2011-04-22 22:03:03 +0200 | [diff] [blame] | 309 | register_syscore_ops(&sa1100irq_syscore_ops); |
| 310 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | device_initcall(sa1100irq_init_devicefs); |
| 314 | |
Dmitry Eremin-Solenikov | affcab3 | 2014-11-28 15:55:16 +0100 | [diff] [blame] | 315 | static asmlinkage void __exception_irq_entry |
| 316 | sa1100_handle_irq(struct pt_regs *regs) |
| 317 | { |
| 318 | uint32_t icip, icmr, mask; |
| 319 | |
| 320 | do { |
| 321 | icip = (ICIP); |
| 322 | icmr = (ICMR); |
| 323 | mask = icip & icmr; |
| 324 | |
| 325 | if (mask == 0) |
| 326 | break; |
| 327 | |
| 328 | handle_IRQ(ffs(mask) - 1 + IRQ_GPIO0, regs); |
| 329 | } while (1); |
| 330 | } |
| 331 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | void __init sa1100_init_irq(void) |
| 333 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 334 | request_resource(&iomem_resource, &irq_resource); |
| 335 | |
| 336 | /* disable all IRQs */ |
| 337 | ICMR = 0; |
| 338 | |
| 339 | /* all IRQs are IRQ, not FIQ */ |
| 340 | ICLR = 0; |
| 341 | |
| 342 | /* clear all GPIO edge detects */ |
| 343 | GFER = 0; |
| 344 | GRER = 0; |
| 345 | GEDR = -1; |
| 346 | |
| 347 | /* |
| 348 | * Whatever the doc says, this has to be set for the wait-on-irq |
| 349 | * instruction to work... on a SA1100 rev 9 at least. |
| 350 | */ |
| 351 | ICCR = 1; |
| 352 | |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 353 | sa1100_low_gpio_irqdomain = irq_domain_add_legacy(NULL, |
| 354 | 11, IRQ_GPIO0, 0, |
| 355 | &sa1100_low_gpio_irqdomain_ops, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 357 | sa1100_normal_irqdomain = irq_domain_add_legacy(NULL, |
Dmitry Eremin-Solenikov | 0ebd465f | 2014-11-28 15:57:11 +0100 | [diff] [blame] | 358 | 21, IRQ_GPIO11_27, 11, |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 359 | &sa1100_normal_irqdomain_ops, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | |
Dmitry Eremin-Solenikov | 1eca42b | 2014-11-28 15:56:54 +0100 | [diff] [blame] | 361 | sa1100_high_gpio_irqdomain = irq_domain_add_legacy(NULL, |
| 362 | 17, IRQ_GPIO11, 11, |
| 363 | &sa1100_high_gpio_irqdomain_ops, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | |
| 365 | /* |
| 366 | * Install handler for GPIO 11-27 edge detect interrupts |
| 367 | */ |
Thomas Gleixner | 6845664a | 2011-03-24 13:25:22 +0100 | [diff] [blame] | 368 | irq_set_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler); |
Dmitry Baryshkov | 45528e3 | 2008-04-10 13:31:47 +0100 | [diff] [blame] | 369 | |
Dmitry Eremin-Solenikov | affcab3 | 2014-11-28 15:55:16 +0100 | [diff] [blame] | 370 | set_handle_irq(sa1100_handle_irq); |
| 371 | |
Dmitry Baryshkov | 45528e3 | 2008-04-10 13:31:47 +0100 | [diff] [blame] | 372 | sa1100_init_gpio(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | } |