aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/irq.c')
-rw-r--r--arch/arm/mach-at91/irq.c36
1 files changed, 18 insertions, 18 deletions
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
37static void at91_aic_mask_irq(unsigned int irq) 37static 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
43static void at91_aic_unmask_irq(unsigned int irq) 43static 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
49unsigned int at91_extern_irq; 49unsigned 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
53static int at91_aic_set_type(unsigned irq, unsigned type) 53static 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)
87static u32 wakeups; 87static u32 wakeups;
88static u32 backups; 88static u32 backups;
89 89
90static int at91_aic_set_wake(unsigned irq, unsigned value) 90static 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
120static struct irq_chip at91_aic_chip = { 120static 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/*