diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2014-11-28 09:56:13 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-12-03 11:07:31 -0500 |
commit | 0fea30c63eb09e62e2c9b271d7085ac538413973 (patch) | |
tree | 26911a8324177d79bfd4e1e02a215c83fe10e364 /arch | |
parent | ff7f6d0bc5599909da2ba0221d0893cb5ee64d00 (diff) |
ARM: 8229/1: sa1100: replace irq numbers with names in irq driver
In preparation for further changes replace direct IRQ numbers with
pre-defined names. This imposes no real code changes.
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')
-rw-r--r-- | arch/arm/mach-sa1100/irq.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index 4a1bd5ebee1c..0b29d277d53f 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c | |||
@@ -37,14 +37,14 @@ static int GPIO_IRQ_mask = (1 << 11) - 1; | |||
37 | /* | 37 | /* |
38 | * To get the GPIO number from an IRQ number | 38 | * To get the GPIO number from an IRQ number |
39 | */ | 39 | */ |
40 | #define GPIO_11_27_IRQ(i) ((i) - 21) | 40 | #define GPIO_11_27_IRQ(i) ((i) + 11 - IRQ_GPIO11) |
41 | #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) | 41 | #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) |
42 | 42 | ||
43 | static int sa1100_gpio_type(struct irq_data *d, unsigned int type) | 43 | static int sa1100_gpio_type(struct irq_data *d, unsigned int type) |
44 | { | 44 | { |
45 | unsigned int mask; | 45 | unsigned int mask; |
46 | 46 | ||
47 | if (d->irq <= 10) | 47 | if (d->irq <= IRQ_GPIO10) |
48 | mask = 1 << d->irq; | 48 | mask = 1 << d->irq; |
49 | else | 49 | else |
50 | mask = GPIO11_27_MASK(d->irq); | 50 | mask = GPIO11_27_MASK(d->irq); |
@@ -71,7 +71,7 @@ static int sa1100_gpio_type(struct irq_data *d, unsigned int type) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10. | 74 | * GPIO IRQs must be acknowledged. This is for IRQs from GPIO0 to 10. |
75 | */ | 75 | */ |
76 | static void sa1100_low_gpio_ack(struct irq_data *d) | 76 | static void sa1100_low_gpio_ack(struct irq_data *d) |
77 | { | 77 | { |
@@ -189,7 +189,7 @@ static struct irq_chip sa1100_high_gpio_chip = { | |||
189 | 189 | ||
190 | /* | 190 | /* |
191 | * We don't need to ACK IRQs on the SA1100 unless they're GPIOs | 191 | * We don't need to ACK IRQs on the SA1100 unless they're GPIOs |
192 | * this is for internal IRQs i.e. from 11 to 31. | 192 | * this is for internal IRQs i.e. from IRQ LCD to RTCAlrm. |
193 | */ | 193 | */ |
194 | static void sa1100_mask_irq(struct irq_data *d) | 194 | static void sa1100_mask_irq(struct irq_data *d) |
195 | { | 195 | { |
@@ -332,19 +332,19 @@ void __init sa1100_init_irq(void) | |||
332 | */ | 332 | */ |
333 | ICCR = 1; | 333 | ICCR = 1; |
334 | 334 | ||
335 | for (irq = 0; irq <= 10; irq++) { | 335 | for (irq = IRQ_GPIO0; irq <= IRQ_GPIO10; irq++) { |
336 | irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, | 336 | irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, |
337 | handle_edge_irq); | 337 | handle_edge_irq); |
338 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 338 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
339 | } | 339 | } |
340 | 340 | ||
341 | for (irq = 12; irq <= 31; irq++) { | 341 | for (irq = IRQ_LCD; irq <= IRQ_RTCAlrm; irq++) { |
342 | irq_set_chip_and_handler(irq, &sa1100_normal_chip, | 342 | irq_set_chip_and_handler(irq, &sa1100_normal_chip, |
343 | handle_level_irq); | 343 | handle_level_irq); |
344 | set_irq_flags(irq, IRQF_VALID); | 344 | set_irq_flags(irq, IRQF_VALID); |
345 | } | 345 | } |
346 | 346 | ||
347 | for (irq = 32; irq <= 48; irq++) { | 347 | for (irq = IRQ_GPIO11; irq <= IRQ_GPIO27; irq++) { |
348 | irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, | 348 | irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, |
349 | handle_edge_irq); | 349 | handle_edge_irq); |
350 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 350 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |