diff options
-rw-r--r-- | arch/arm/mach-davinci/cp_intc.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-davinci/gpio.c | 46 | ||||
-rw-r--r-- | arch/arm/mach-davinci/irq.c | 26 |
3 files changed, 51 insertions, 51 deletions
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c index bb4c40ecb803..9abc80a86a22 100644 --- a/arch/arm/mach-davinci/cp_intc.c +++ b/arch/arm/mach-davinci/cp_intc.c | |||
@@ -26,30 +26,30 @@ static inline void cp_intc_write(unsigned long value, unsigned offset) | |||
26 | __raw_writel(value, davinci_intc_base + offset); | 26 | __raw_writel(value, davinci_intc_base + offset); |
27 | } | 27 | } |
28 | 28 | ||
29 | static void cp_intc_ack_irq(unsigned int irq) | 29 | static void cp_intc_ack_irq(struct irq_data *d) |
30 | { | 30 | { |
31 | cp_intc_write(irq, CP_INTC_SYS_STAT_IDX_CLR); | 31 | cp_intc_write(d->irq, CP_INTC_SYS_STAT_IDX_CLR); |
32 | } | 32 | } |
33 | 33 | ||
34 | /* Disable interrupt */ | 34 | /* Disable interrupt */ |
35 | static void cp_intc_mask_irq(unsigned int irq) | 35 | static void cp_intc_mask_irq(struct irq_data *d) |
36 | { | 36 | { |
37 | /* XXX don't know why we need to disable nIRQ here... */ | 37 | /* XXX don't know why we need to disable nIRQ here... */ |
38 | cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); | 38 | cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); |
39 | cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_CLR); | 39 | cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_CLR); |
40 | cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); | 40 | cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); |
41 | } | 41 | } |
42 | 42 | ||
43 | /* Enable interrupt */ | 43 | /* Enable interrupt */ |
44 | static void cp_intc_unmask_irq(unsigned int irq) | 44 | static void cp_intc_unmask_irq(struct irq_data *d) |
45 | { | 45 | { |
46 | cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_SET); | 46 | cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_SET); |
47 | } | 47 | } |
48 | 48 | ||
49 | static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type) | 49 | static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type) |
50 | { | 50 | { |
51 | unsigned reg = BIT_WORD(irq); | 51 | unsigned reg = BIT_WORD(d->irq); |
52 | unsigned mask = BIT_MASK(irq); | 52 | unsigned mask = BIT_MASK(d->irq); |
53 | unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); | 53 | unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); |
54 | unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); | 54 | unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); |
55 | 55 | ||
@@ -85,18 +85,18 @@ static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type) | |||
85 | * generic drivers which call {enable|disable}_irq_wake for | 85 | * generic drivers which call {enable|disable}_irq_wake for |
86 | * wake up interrupt sources (eg RTC on DA850). | 86 | * wake up interrupt sources (eg RTC on DA850). |
87 | */ | 87 | */ |
88 | static int cp_intc_set_wake(unsigned int irq, unsigned int on) | 88 | static int cp_intc_set_wake(struct irq_data *d, unsigned int on) |
89 | { | 89 | { |
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | static struct irq_chip cp_intc_irq_chip = { | 93 | static struct irq_chip cp_intc_irq_chip = { |
94 | .name = "cp_intc", | 94 | .name = "cp_intc", |
95 | .ack = cp_intc_ack_irq, | 95 | .irq_ack = cp_intc_ack_irq, |
96 | .mask = cp_intc_mask_irq, | 96 | .irq_mask = cp_intc_mask_irq, |
97 | .unmask = cp_intc_unmask_irq, | 97 | .irq_unmask = cp_intc_unmask_irq, |
98 | .set_type = cp_intc_set_irq_type, | 98 | .irq_set_type = cp_intc_set_irq_type, |
99 | .set_wake = cp_intc_set_wake, | 99 | .irq_set_wake = cp_intc_set_wake, |
100 | }; | 100 | }; |
101 | 101 | ||
102 | void __init cp_intc_init(void) | 102 | void __init cp_intc_init(void) |
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c index bf0ff587e46a..20d66e5e4663 100644 --- a/arch/arm/mach-davinci/gpio.c +++ b/arch/arm/mach-davinci/gpio.c | |||
@@ -205,20 +205,20 @@ pure_initcall(davinci_gpio_setup); | |||
205 | * serve as EDMA event triggers. | 205 | * serve as EDMA event triggers. |
206 | */ | 206 | */ |
207 | 207 | ||
208 | static void gpio_irq_disable(unsigned irq) | 208 | static void gpio_irq_disable(struct irq_data *d) |
209 | { | 209 | { |
210 | struct davinci_gpio_regs __iomem *g = irq2regs(irq); | 210 | struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); |
211 | u32 mask = (u32) get_irq_data(irq); | 211 | u32 mask = (u32) irq_data_get_irq_data(d); |
212 | 212 | ||
213 | __raw_writel(mask, &g->clr_falling); | 213 | __raw_writel(mask, &g->clr_falling); |
214 | __raw_writel(mask, &g->clr_rising); | 214 | __raw_writel(mask, &g->clr_rising); |
215 | } | 215 | } |
216 | 216 | ||
217 | static void gpio_irq_enable(unsigned irq) | 217 | static void gpio_irq_enable(struct irq_data *d) |
218 | { | 218 | { |
219 | struct davinci_gpio_regs __iomem *g = irq2regs(irq); | 219 | struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); |
220 | u32 mask = (u32) get_irq_data(irq); | 220 | u32 mask = (u32) irq_data_get_irq_data(d); |
221 | unsigned status = irq_desc[irq].status; | 221 | unsigned status = irq_desc[d->irq].status; |
222 | 222 | ||
223 | status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING; | 223 | status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING; |
224 | if (!status) | 224 | if (!status) |
@@ -230,19 +230,19 @@ static void gpio_irq_enable(unsigned irq) | |||
230 | __raw_writel(mask, &g->set_rising); | 230 | __raw_writel(mask, &g->set_rising); |
231 | } | 231 | } |
232 | 232 | ||
233 | static int gpio_irq_type(unsigned irq, unsigned trigger) | 233 | static int gpio_irq_type(struct irq_data *d, unsigned trigger) |
234 | { | 234 | { |
235 | struct davinci_gpio_regs __iomem *g = irq2regs(irq); | 235 | struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); |
236 | u32 mask = (u32) get_irq_data(irq); | 236 | u32 mask = (u32) irq_data_get_irq_data(d); |
237 | 237 | ||
238 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) | 238 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) |
239 | return -EINVAL; | 239 | return -EINVAL; |
240 | 240 | ||
241 | irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; | 241 | irq_desc[d->irq].status &= ~IRQ_TYPE_SENSE_MASK; |
242 | irq_desc[irq].status |= trigger; | 242 | irq_desc[d->irq].status |= trigger; |
243 | 243 | ||
244 | /* don't enable the IRQ if it's currently disabled */ | 244 | /* don't enable the IRQ if it's currently disabled */ |
245 | if (irq_desc[irq].depth == 0) { | 245 | if (irq_desc[d->irq].depth == 0) { |
246 | __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) | 246 | __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) |
247 | ? &g->set_falling : &g->clr_falling); | 247 | ? &g->set_falling : &g->clr_falling); |
248 | __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) | 248 | __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) |
@@ -253,9 +253,9 @@ static int gpio_irq_type(unsigned irq, unsigned trigger) | |||
253 | 253 | ||
254 | static struct irq_chip gpio_irqchip = { | 254 | static struct irq_chip gpio_irqchip = { |
255 | .name = "GPIO", | 255 | .name = "GPIO", |
256 | .enable = gpio_irq_enable, | 256 | .irq_enable = gpio_irq_enable, |
257 | .disable = gpio_irq_disable, | 257 | .irq_disable = gpio_irq_disable, |
258 | .set_type = gpio_irq_type, | 258 | .irq_set_type = gpio_irq_type, |
259 | }; | 259 | }; |
260 | 260 | ||
261 | static void | 261 | static void |
@@ -269,8 +269,8 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
269 | mask <<= 16; | 269 | mask <<= 16; |
270 | 270 | ||
271 | /* temporarily mask (level sensitive) parent IRQ */ | 271 | /* temporarily mask (level sensitive) parent IRQ */ |
272 | desc->chip->mask(irq); | 272 | desc->irq_data.chip->irq_mask(&desc->irq_data); |
273 | desc->chip->ack(irq); | 273 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
274 | while (1) { | 274 | while (1) { |
275 | u32 status; | 275 | u32 status; |
276 | int n; | 276 | int n; |
@@ -293,7 +293,7 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
293 | status >>= res; | 293 | status >>= res; |
294 | } | 294 | } |
295 | } | 295 | } |
296 | desc->chip->unmask(irq); | 296 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
297 | /* now it may re-trigger */ | 297 | /* now it may re-trigger */ |
298 | } | 298 | } |
299 | 299 | ||
@@ -320,10 +320,10 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset) | |||
320 | return -ENODEV; | 320 | return -ENODEV; |
321 | } | 321 | } |
322 | 322 | ||
323 | static int gpio_irq_type_unbanked(unsigned irq, unsigned trigger) | 323 | static int gpio_irq_type_unbanked(struct irq_data *d, unsigned trigger) |
324 | { | 324 | { |
325 | struct davinci_gpio_regs __iomem *g = irq2regs(irq); | 325 | struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); |
326 | u32 mask = (u32) get_irq_data(irq); | 326 | u32 mask = (u32) irq_data_get_irq_data(d); |
327 | 327 | ||
328 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) | 328 | if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) |
329 | return -EINVAL; | 329 | return -EINVAL; |
@@ -397,7 +397,7 @@ static int __init davinci_gpio_irq_setup(void) | |||
397 | irq = bank_irq; | 397 | irq = bank_irq; |
398 | gpio_irqchip_unbanked = *get_irq_desc_chip(irq_to_desc(irq)); | 398 | gpio_irqchip_unbanked = *get_irq_desc_chip(irq_to_desc(irq)); |
399 | gpio_irqchip_unbanked.name = "GPIO-AINTC"; | 399 | gpio_irqchip_unbanked.name = "GPIO-AINTC"; |
400 | gpio_irqchip_unbanked.set_type = gpio_irq_type_unbanked; | 400 | gpio_irqchip_unbanked.irq_set_type = gpio_irq_type_unbanked; |
401 | 401 | ||
402 | /* default trigger: both edges */ | 402 | /* default trigger: both edges */ |
403 | g = gpio2regs(0); | 403 | g = gpio2regs(0); |
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c index 784ddf3c5ad4..5e05c9b64e1f 100644 --- a/arch/arm/mach-davinci/irq.c +++ b/arch/arm/mach-davinci/irq.c | |||
@@ -53,14 +53,14 @@ static inline void davinci_irq_writel(unsigned long value, int offset) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | /* Disable interrupt */ | 55 | /* Disable interrupt */ |
56 | static void davinci_mask_irq(unsigned int irq) | 56 | static void davinci_mask_irq(struct irq_data *d) |
57 | { | 57 | { |
58 | unsigned int mask; | 58 | unsigned int mask; |
59 | u32 l; | 59 | u32 l; |
60 | 60 | ||
61 | mask = 1 << IRQ_BIT(irq); | 61 | mask = 1 << IRQ_BIT(d->irq); |
62 | 62 | ||
63 | if (irq > 31) { | 63 | if (d->irq > 31) { |
64 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); | 64 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); |
65 | l &= ~mask; | 65 | l &= ~mask; |
66 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); | 66 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); |
@@ -72,14 +72,14 @@ static void davinci_mask_irq(unsigned int irq) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /* Enable interrupt */ | 74 | /* Enable interrupt */ |
75 | static void davinci_unmask_irq(unsigned int irq) | 75 | static void davinci_unmask_irq(struct irq_data *d) |
76 | { | 76 | { |
77 | unsigned int mask; | 77 | unsigned int mask; |
78 | u32 l; | 78 | u32 l; |
79 | 79 | ||
80 | mask = 1 << IRQ_BIT(irq); | 80 | mask = 1 << IRQ_BIT(d->irq); |
81 | 81 | ||
82 | if (irq > 31) { | 82 | if (d->irq > 31) { |
83 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); | 83 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); |
84 | l |= mask; | 84 | l |= mask; |
85 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); | 85 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); |
@@ -91,23 +91,23 @@ static void davinci_unmask_irq(unsigned int irq) | |||
91 | } | 91 | } |
92 | 92 | ||
93 | /* EOI interrupt */ | 93 | /* EOI interrupt */ |
94 | static void davinci_ack_irq(unsigned int irq) | 94 | static void davinci_ack_irq(struct irq_data *d) |
95 | { | 95 | { |
96 | unsigned int mask; | 96 | unsigned int mask; |
97 | 97 | ||
98 | mask = 1 << IRQ_BIT(irq); | 98 | mask = 1 << IRQ_BIT(d->irq); |
99 | 99 | ||
100 | if (irq > 31) | 100 | if (d->irq > 31) |
101 | davinci_irq_writel(mask, IRQ_REG1_OFFSET); | 101 | davinci_irq_writel(mask, IRQ_REG1_OFFSET); |
102 | else | 102 | else |
103 | davinci_irq_writel(mask, IRQ_REG0_OFFSET); | 103 | davinci_irq_writel(mask, IRQ_REG0_OFFSET); |
104 | } | 104 | } |
105 | 105 | ||
106 | static struct irq_chip davinci_irq_chip_0 = { | 106 | static struct irq_chip davinci_irq_chip_0 = { |
107 | .name = "AINTC", | 107 | .name = "AINTC", |
108 | .ack = davinci_ack_irq, | 108 | .irq_ack = davinci_ack_irq, |
109 | .mask = davinci_mask_irq, | 109 | .irq_mask = davinci_mask_irq, |
110 | .unmask = davinci_unmask_irq, | 110 | .irq_unmask = davinci_unmask_irq, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | /* ARM Interrupt Controller Initialization */ | 113 | /* ARM Interrupt Controller Initialization */ |