diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2010-11-29 04:26:19 -0500 |
---|---|---|
committer | Lennert Buytenhek <buytenh@wantstofly.org> | 2011-01-13 11:18:22 -0500 |
commit | da0f9403d41e6cb210459571afddfce3646181ca (patch) | |
tree | e4233a61dd4122fc36518dbea0cc4e9d4f5ea10f /arch/arm/mach-at91 | |
parent | 54502602c13dd2e7d1244942b9b3638ebe944760 (diff) |
ARM: at91: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/gpio.c | 34 | ||||
-rw-r--r-- | arch/arm/mach-at91/irq.c | 36 |
2 files changed, 35 insertions, 35 deletions
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index ae4772e744ac..af818a21587c 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -274,10 +274,10 @@ EXPORT_SYMBOL(at91_get_gpio_value); | |||
274 | static u32 wakeups[MAX_GPIO_BANKS]; | 274 | static u32 wakeups[MAX_GPIO_BANKS]; |
275 | static u32 backups[MAX_GPIO_BANKS]; | 275 | static u32 backups[MAX_GPIO_BANKS]; |
276 | 276 | ||
277 | static int gpio_irq_set_wake(unsigned pin, unsigned state) | 277 | static int gpio_irq_set_wake(struct irq_data *d, unsigned state) |
278 | { | 278 | { |
279 | unsigned mask = pin_to_mask(pin); | 279 | unsigned mask = pin_to_mask(d->irq); |
280 | unsigned bank = (pin - PIN_BASE) / 32; | 280 | unsigned bank = (d->irq - PIN_BASE) / 32; |
281 | 281 | ||
282 | if (unlikely(bank >= MAX_GPIO_BANKS)) | 282 | if (unlikely(bank >= MAX_GPIO_BANKS)) |
283 | return -EINVAL; | 283 | return -EINVAL; |
@@ -344,25 +344,25 @@ void at91_gpio_resume(void) | |||
344 | * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. | 344 | * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. |
345 | */ | 345 | */ |
346 | 346 | ||
347 | static void gpio_irq_mask(unsigned pin) | 347 | static void gpio_irq_mask(struct irq_data *d) |
348 | { | 348 | { |
349 | void __iomem *pio = pin_to_controller(pin); | 349 | void __iomem *pio = pin_to_controller(d->irq); |
350 | unsigned mask = pin_to_mask(pin); | 350 | unsigned mask = pin_to_mask(d->irq); |
351 | 351 | ||
352 | if (pio) | 352 | if (pio) |
353 | __raw_writel(mask, pio + PIO_IDR); | 353 | __raw_writel(mask, pio + PIO_IDR); |
354 | } | 354 | } |
355 | 355 | ||
356 | static void gpio_irq_unmask(unsigned pin) | 356 | static void gpio_irq_unmask(struct irq_data *d) |
357 | { | 357 | { |
358 | void __iomem *pio = pin_to_controller(pin); | 358 | void __iomem *pio = pin_to_controller(d->irq); |
359 | unsigned mask = pin_to_mask(pin); | 359 | unsigned mask = pin_to_mask(d->irq); |
360 | 360 | ||
361 | if (pio) | 361 | if (pio) |
362 | __raw_writel(mask, pio + PIO_IER); | 362 | __raw_writel(mask, pio + PIO_IER); |
363 | } | 363 | } |
364 | 364 | ||
365 | static int gpio_irq_type(unsigned pin, unsigned type) | 365 | static int gpio_irq_type(struct irq_data *d, unsigned type) |
366 | { | 366 | { |
367 | switch (type) { | 367 | switch (type) { |
368 | case IRQ_TYPE_NONE: | 368 | case IRQ_TYPE_NONE: |
@@ -375,10 +375,10 @@ static int gpio_irq_type(unsigned pin, unsigned type) | |||
375 | 375 | ||
376 | static struct irq_chip gpio_irqchip = { | 376 | static struct irq_chip gpio_irqchip = { |
377 | .name = "GPIO", | 377 | .name = "GPIO", |
378 | .mask = gpio_irq_mask, | 378 | .irq_mask = gpio_irq_mask, |
379 | .unmask = gpio_irq_unmask, | 379 | .irq_unmask = gpio_irq_unmask, |
380 | .set_type = gpio_irq_type, | 380 | .irq_set_type = gpio_irq_type, |
381 | .set_wake = gpio_irq_set_wake, | 381 | .irq_set_wake = gpio_irq_set_wake, |
382 | }; | 382 | }; |
383 | 383 | ||
384 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 384 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) |
@@ -393,7 +393,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
393 | pio = at91_gpio->regbase; | 393 | pio = at91_gpio->regbase; |
394 | 394 | ||
395 | /* temporarily mask (level sensitive) parent IRQ */ | 395 | /* temporarily mask (level sensitive) parent IRQ */ |
396 | desc->chip->ack(irq); | 396 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
397 | for (;;) { | 397 | for (;;) { |
398 | /* Reading ISR acks pending (edge triggered) GPIO interrupts. | 398 | /* Reading ISR acks pending (edge triggered) GPIO interrupts. |
399 | * When there none are pending, we're finished unless we need | 399 | * When there none are pending, we're finished unless we need |
@@ -419,7 +419,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
419 | * another IRQ must be generated before it actually gets | 419 | * another IRQ must be generated before it actually gets |
420 | * here to be disabled on the GPIO controller. | 420 | * here to be disabled on the GPIO controller. |
421 | */ | 421 | */ |
422 | gpio_irq_mask(pin); | 422 | gpio_irq_mask(irq_get_irq_data(pin)); |
423 | } | 423 | } |
424 | else | 424 | else |
425 | generic_handle_irq(pin); | 425 | generic_handle_irq(pin); |
@@ -429,7 +429,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
429 | isr >>= 1; | 429 | isr >>= 1; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | desc->chip->unmask(irq); | 432 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
433 | /* now it may re-trigger */ | 433 | /* now it may re-trigger */ |
434 | } | 434 | } |
435 | 435 | ||
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c index da3494a53423..b56d6b3a4087 100644 --- a/arch/arm/mach-at91/irq.c +++ b/arch/arm/mach-at91/irq.c | |||
@@ -34,23 +34,23 @@ | |||
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | 35 | ||
36 | 36 | ||
37 | static void at91_aic_mask_irq(unsigned int irq) | 37 | static void at91_aic_mask_irq(struct irq_data *d) |
38 | { | 38 | { |
39 | /* Disable interrupt on AIC */ | 39 | /* Disable interrupt on AIC */ |
40 | at91_sys_write(AT91_AIC_IDCR, 1 << irq); | 40 | at91_sys_write(AT91_AIC_IDCR, 1 << d->irq); |
41 | } | 41 | } |
42 | 42 | ||
43 | static void at91_aic_unmask_irq(unsigned int irq) | 43 | static void at91_aic_unmask_irq(struct irq_data *d) |
44 | { | 44 | { |
45 | /* Enable interrupt on AIC */ | 45 | /* Enable interrupt on AIC */ |
46 | at91_sys_write(AT91_AIC_IECR, 1 << irq); | 46 | at91_sys_write(AT91_AIC_IECR, 1 << d->irq); |
47 | } | 47 | } |
48 | 48 | ||
49 | unsigned int at91_extern_irq; | 49 | unsigned int at91_extern_irq; |
50 | 50 | ||
51 | #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) | 51 | #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) |
52 | 52 | ||
53 | static int at91_aic_set_type(unsigned irq, unsigned type) | 53 | static int at91_aic_set_type(struct irq_data *d, unsigned type) |
54 | { | 54 | { |
55 | unsigned int smr, srctype; | 55 | unsigned int smr, srctype; |
56 | 56 | ||
@@ -62,13 +62,13 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
62 | srctype = AT91_AIC_SRCTYPE_RISING; | 62 | srctype = AT91_AIC_SRCTYPE_RISING; |
63 | break; | 63 | break; |
64 | case IRQ_TYPE_LEVEL_LOW: | 64 | case IRQ_TYPE_LEVEL_LOW: |
65 | if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ | 65 | if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ |
66 | srctype = AT91_AIC_SRCTYPE_LOW; | 66 | srctype = AT91_AIC_SRCTYPE_LOW; |
67 | else | 67 | else |
68 | return -EINVAL; | 68 | return -EINVAL; |
69 | break; | 69 | break; |
70 | case IRQ_TYPE_EDGE_FALLING: | 70 | case IRQ_TYPE_EDGE_FALLING: |
71 | if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ | 71 | if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ |
72 | srctype = AT91_AIC_SRCTYPE_FALLING; | 72 | srctype = AT91_AIC_SRCTYPE_FALLING; |
73 | else | 73 | else |
74 | return -EINVAL; | 74 | return -EINVAL; |
@@ -77,8 +77,8 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
77 | return -EINVAL; | 77 | return -EINVAL; |
78 | } | 78 | } |
79 | 79 | ||
80 | smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE; | 80 | smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; |
81 | at91_sys_write(AT91_AIC_SMR(irq), smr | srctype); | 81 | at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
@@ -87,15 +87,15 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
87 | static u32 wakeups; | 87 | static u32 wakeups; |
88 | static u32 backups; | 88 | static u32 backups; |
89 | 89 | ||
90 | static int at91_aic_set_wake(unsigned irq, unsigned value) | 90 | static int at91_aic_set_wake(struct irq_data *d, unsigned value) |
91 | { | 91 | { |
92 | if (unlikely(irq >= 32)) | 92 | if (unlikely(d->irq >= 32)) |
93 | return -EINVAL; | 93 | return -EINVAL; |
94 | 94 | ||
95 | if (value) | 95 | if (value) |
96 | wakeups |= (1 << irq); | 96 | wakeups |= (1 << d->irq); |
97 | else | 97 | else |
98 | wakeups &= ~(1 << irq); | 98 | wakeups &= ~(1 << d->irq); |
99 | 99 | ||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
@@ -119,11 +119,11 @@ void at91_irq_resume(void) | |||
119 | 119 | ||
120 | static struct irq_chip at91_aic_chip = { | 120 | static struct irq_chip at91_aic_chip = { |
121 | .name = "AIC", | 121 | .name = "AIC", |
122 | .ack = at91_aic_mask_irq, | 122 | .irq_ack = at91_aic_mask_irq, |
123 | .mask = at91_aic_mask_irq, | 123 | .irq_mask = at91_aic_mask_irq, |
124 | .unmask = at91_aic_unmask_irq, | 124 | .irq_unmask = at91_aic_unmask_irq, |
125 | .set_type = at91_aic_set_type, | 125 | .irq_set_type = at91_aic_set_type, |
126 | .set_wake = at91_aic_set_wake, | 126 | .irq_set_wake = at91_aic_set_wake, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | /* | 129 | /* |