aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ks8695/irq.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-11-29 04:34:14 -0500
committerLennert Buytenhek <buytenh@wantstofly.org>2011-01-13 11:18:41 -0500
commit3cdb791bdabd3771f93522871755ec97a797d0fd (patch)
treefc2b9e6c1afffc278bd6b97dccb41239da69fe97 /arch/arm/mach-ks8695/irq.c
parentee04087add7fa429fd1e4256705479cd1386adec (diff)
ARM: ks8695: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-ks8695/irq.c')
-rw-r--r--arch/arm/mach-ks8695/irq.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
index e375c1d53f81..7998ccaa6333 100644
--- a/arch/arm/mach-ks8695/irq.c
+++ b/arch/arm/mach-ks8695/irq.c
@@ -34,29 +34,29 @@
34#include <mach/regs-irq.h> 34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36 36
37static void ks8695_irq_mask(unsigned int irqno) 37static void ks8695_irq_mask(struct irq_data *d)
38{ 38{
39 unsigned long inten; 39 unsigned long inten;
40 40
41 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 41 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
42 inten &= ~(1 << irqno); 42 inten &= ~(1 << d->irq);
43 43
44 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 44 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
45} 45}
46 46
47static void ks8695_irq_unmask(unsigned int irqno) 47static void ks8695_irq_unmask(struct irq_data *d)
48{ 48{
49 unsigned long inten; 49 unsigned long inten;
50 50
51 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 51 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
52 inten |= (1 << irqno); 52 inten |= (1 << d->irq);
53 53
54 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 54 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
55} 55}
56 56
57static void ks8695_irq_ack(unsigned int irqno) 57static void ks8695_irq_ack(struct irq_data *d)
58{ 58{
59 __raw_writel((1 << irqno), KS8695_IRQ_VA + KS8695_INTST); 59 __raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
60} 60}
61 61
62 62
@@ -64,7 +64,7 @@ static struct irq_chip ks8695_irq_level_chip;
64static struct irq_chip ks8695_irq_edge_chip; 64static struct irq_chip ks8695_irq_edge_chip;
65 65
66 66
67static int ks8695_irq_set_type(unsigned int irqno, unsigned int type) 67static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
68{ 68{
69 unsigned long ctrl, mode; 69 unsigned long ctrl, mode;
70 unsigned short level_triggered = 0; 70 unsigned short level_triggered = 0;
@@ -93,7 +93,7 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
93 return -EINVAL; 93 return -EINVAL;
94 } 94 }
95 95
96 switch (irqno) { 96 switch (d->irq) {
97 case KS8695_IRQ_EXTERN0: 97 case KS8695_IRQ_EXTERN0:
98 ctrl &= ~IOPC_IOEINT0TM; 98 ctrl &= ~IOPC_IOEINT0TM;
99 ctrl |= IOPC_IOEINT0_MODE(mode); 99 ctrl |= IOPC_IOEINT0_MODE(mode);
@@ -115,12 +115,12 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
115 } 115 }
116 116
117 if (level_triggered) { 117 if (level_triggered) {
118 set_irq_chip(irqno, &ks8695_irq_level_chip); 118 set_irq_chip(d->irq, &ks8695_irq_level_chip);
119 set_irq_handler(irqno, handle_level_irq); 119 set_irq_handler(d->irq, handle_level_irq);
120 } 120 }
121 else { 121 else {
122 set_irq_chip(irqno, &ks8695_irq_edge_chip); 122 set_irq_chip(d->irq, &ks8695_irq_edge_chip);
123 set_irq_handler(irqno, handle_edge_irq); 123 set_irq_handler(d->irq, handle_edge_irq);
124 } 124 }
125 125
126 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC); 126 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
@@ -128,17 +128,17 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
128} 128}
129 129
130static struct irq_chip ks8695_irq_level_chip = { 130static struct irq_chip ks8695_irq_level_chip = {
131 .ack = ks8695_irq_mask, 131 .irq_ack = ks8695_irq_mask,
132 .mask = ks8695_irq_mask, 132 .irq_mask = ks8695_irq_mask,
133 .unmask = ks8695_irq_unmask, 133 .irq_unmask = ks8695_irq_unmask,
134 .set_type = ks8695_irq_set_type, 134 .irq_set_type = ks8695_irq_set_type,
135}; 135};
136 136
137static struct irq_chip ks8695_irq_edge_chip = { 137static struct irq_chip ks8695_irq_edge_chip = {
138 .ack = ks8695_irq_ack, 138 .irq_ack = ks8695_irq_ack,
139 .mask = ks8695_irq_mask, 139 .irq_mask = ks8695_irq_mask,
140 .unmask = ks8695_irq_unmask, 140 .irq_unmask = ks8695_irq_unmask,
141 .set_type = ks8695_irq_set_type, 141 .irq_set_type = ks8695_irq_set_type,
142}; 142};
143 143
144void __init ks8695_init_irq(void) 144void __init ks8695_init_irq(void)
@@ -164,7 +164,8 @@ void __init ks8695_init_irq(void)
164 164
165 /* Edge-triggered interrupts */ 165 /* Edge-triggered interrupts */
166 default: 166 default:
167 ks8695_irq_ack(irq); /* clear pending bit */ 167 /* clear pending bit */
168 ks8695_irq_ack(irq_get_irq_data(irq));
168 set_irq_chip(irq, &ks8695_irq_edge_chip); 169 set_irq_chip(irq, &ks8695_irq_edge_chip);
169 set_irq_handler(irq, handle_edge_irq); 170 set_irq_handler(irq, handle_edge_irq);
170 } 171 }