aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-iop32x/irq.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2006-09-18 18:26:25 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-09-25 05:25:53 -0400
commitc852ac80440db9b0a47f48578e9c6303078abbc1 (patch)
tree0c7fc1ca7700b0196a20242ca306003db7e35fb6 /arch/arm/mach-iop32x/irq.c
parent475549faa161f4e002225f2ef75fdd2a6d83d151 (diff)
[ARM] 3832/1: iop3xx: coding style cleanup
Since the iop32x code isn't iop321-specific, and the iop33x code isn't iop331-specfic, do a s/iop321/iop32x/ and s/iop331/iop33x/, and tidy up the code to conform to the coding style guidelines somewhat better. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-iop32x/irq.c')
-rw-r--r--arch/arm/mach-iop32x/irq.c54
1 files changed, 22 insertions, 32 deletions
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index ff049e02f5f..21294be5a36 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-iop32x/irq.c 2 * arch/arm/mach-iop32x/irq.c
3 * 3 *
4 * Generic IOP32X IRQ handling functionality 4 * Generic IOP32X IRQ handling functionality
5 * 5 *
@@ -9,76 +9,66 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Added IOP3XX chipset and IQ80321 board masking code.
14 *
15 */ 12 */
13
16#include <linux/init.h> 14#include <linux/init.h>
17#include <linux/interrupt.h> 15#include <linux/interrupt.h>
18#include <linux/list.h> 16#include <linux/list.h>
19
20#include <asm/mach/irq.h> 17#include <asm/mach/irq.h>
21#include <asm/irq.h> 18#include <asm/irq.h>
22#include <asm/hardware.h> 19#include <asm/hardware.h>
23
24#include <asm/mach-types.h> 20#include <asm/mach-types.h>
25 21
26static u32 iop321_mask /* = 0 */; 22static u32 iop32x_mask;
27 23
28static inline void intctl_write(u32 val) 24static inline void intctl_write(u32 val)
29{ 25{
30 iop3xx_cp6_enable(); 26 iop3xx_cp6_enable();
31 asm volatile("mcr p6,0,%0,c0,c0,0"::"r" (val)); 27 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
32 iop3xx_cp6_disable(); 28 iop3xx_cp6_disable();
33} 29}
34 30
35static inline void intstr_write(u32 val) 31static inline void intstr_write(u32 val)
36{ 32{
37 iop3xx_cp6_enable(); 33 iop3xx_cp6_enable();
38 asm volatile("mcr p6,0,%0,c4,c0,0"::"r" (val)); 34 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val));
39 iop3xx_cp6_disable(); 35 iop3xx_cp6_disable();
40} 36}
41 37
42static void 38static void
43iop321_irq_mask (unsigned int irq) 39iop32x_irq_mask(unsigned int irq)
44{ 40{
45 41 iop32x_mask &= ~(1 << irq);
46 iop321_mask &= ~(1 << irq); 42 intctl_write(iop32x_mask);
47
48 intctl_write(iop321_mask);
49} 43}
50 44
51static void 45static void
52iop321_irq_unmask (unsigned int irq) 46iop32x_irq_unmask(unsigned int irq)
53{ 47{
54 iop321_mask |= (1 << irq); 48 iop32x_mask |= 1 << irq;
55 49 intctl_write(iop32x_mask);
56 intctl_write(iop321_mask);
57} 50}
58 51
59struct irq_chip ext_chip = { 52struct irq_chip ext_chip = {
60 .name = "IOP", 53 .name = "IOP32x",
61 .ack = iop321_irq_mask, 54 .ack = iop32x_irq_mask,
62 .mask = iop321_irq_mask, 55 .mask = iop32x_irq_mask,
63 .unmask = iop321_irq_unmask, 56 .unmask = iop32x_irq_unmask,
64}; 57};
65 58
66void __init iop321_init_irq(void) 59void __init iop32x_init_irq(void)
67{ 60{
68 unsigned int i; 61 int i;
69 62
70 intctl_write(0); // disable all interrupts 63 intctl_write(0);
71 intstr_write(0); // treat all as IRQ 64 intstr_write(0);
72 if(machine_is_iq80321() || 65 if (machine_is_iq80321() ||
73 machine_is_iq31244()) // all interrupts are inputs to chip 66 machine_is_iq31244())
74 *IOP3XX_PCIIRSR = 0x0f; 67 *IOP3XX_PCIIRSR = 0x0f;
75 68
76 for(i = 0; i < NR_IRQS; i++) 69 for (i = 0; i < NR_IRQS; i++) {
77 {
78 set_irq_chip(i, &ext_chip); 70 set_irq_chip(i, &ext_chip);
79 set_irq_handler(i, do_level_IRQ); 71 set_irq_handler(i, do_level_IRQ);
80 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 72 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
81
82 } 73 }
83} 74}
84