diff options
Diffstat (limited to 'arch/m32r/platforms/oaks32r/setup.c')
-rw-r--r-- | arch/m32r/platforms/oaks32r/setup.c | 65 |
1 files changed, 22 insertions, 43 deletions
diff --git a/arch/m32r/platforms/oaks32r/setup.c b/arch/m32r/platforms/oaks32r/setup.c index d11d93bf74f5..19a02db7b818 100644 --- a/arch/m32r/platforms/oaks32r/setup.c +++ b/arch/m32r/platforms/oaks32r/setup.c | |||
@@ -37,39 +37,30 @@ static void enable_oaks32r_irq(unsigned int irq) | |||
37 | outl(data, port); | 37 | outl(data, port); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void mask_and_ack_mappi(unsigned int irq) | 40 | static void mask_oaks32r(struct irq_data *data) |
41 | { | 41 | { |
42 | disable_oaks32r_irq(irq); | 42 | disable_oaks32r_irq(data->irq); |
43 | } | 43 | } |
44 | 44 | ||
45 | static void end_oaks32r_irq(unsigned int irq) | 45 | static void unmask_oaks32r(struct irq_data *data) |
46 | { | 46 | { |
47 | enable_oaks32r_irq(irq); | 47 | enable_oaks32r_irq(data->irq); |
48 | } | 48 | } |
49 | 49 | ||
50 | static unsigned int startup_oaks32r_irq(unsigned int irq) | 50 | static void shutdown_oaks32r(struct irq_data *data) |
51 | { | ||
52 | enable_oaks32r_irq(irq); | ||
53 | return (0); | ||
54 | } | ||
55 | |||
56 | static void shutdown_oaks32r_irq(unsigned int irq) | ||
57 | { | 51 | { |
58 | unsigned long port; | 52 | unsigned long port; |
59 | 53 | ||
60 | port = irq2port(irq); | 54 | port = irq2port(data->irq); |
61 | outl(M32R_ICUCR_ILEVEL7, port); | 55 | outl(M32R_ICUCR_ILEVEL7, port); |
62 | } | 56 | } |
63 | 57 | ||
64 | static struct irq_chip oaks32r_irq_type = | 58 | static struct irq_chip oaks32r_irq_type = |
65 | { | 59 | { |
66 | .name = "OAKS32R-IRQ", | 60 | .name = "OAKS32R-IRQ", |
67 | .startup = startup_oaks32r_irq, | 61 | .irq_shutdown = shutdown_oaks32r, |
68 | .shutdown = shutdown_oaks32r_irq, | 62 | .irq_mask = mask_oaks32r, |
69 | .enable = enable_oaks32r_irq, | 63 | .irq_unmask = unmask_oaks32r, |
70 | .disable = disable_oaks32r_irq, | ||
71 | .ack = mask_and_ack_mappi, | ||
72 | .end = end_oaks32r_irq | ||
73 | }; | 64 | }; |
74 | 65 | ||
75 | void __init init_IRQ(void) | 66 | void __init init_IRQ(void) |
@@ -83,52 +74,40 @@ void __init init_IRQ(void) | |||
83 | 74 | ||
84 | #ifdef CONFIG_NE2000 | 75 | #ifdef CONFIG_NE2000 |
85 | /* INT3 : LAN controller (RTL8019AS) */ | 76 | /* INT3 : LAN controller (RTL8019AS) */ |
86 | irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; | 77 | set_irq_chip_and_handler(M32R_IRQ_INT3, &oaks32r_irq_type, |
87 | irq_desc[M32R_IRQ_INT3].chip = &oaks32r_irq_type; | 78 | handle_level_irq); |
88 | irq_desc[M32R_IRQ_INT3].action = 0; | ||
89 | irq_desc[M32R_IRQ_INT3].depth = 1; | ||
90 | icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; | 79 | icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; |
91 | disable_oaks32r_irq(M32R_IRQ_INT3); | 80 | disable_oaks32r_irq(M32R_IRQ_INT3); |
92 | #endif /* CONFIG_M32R_NE2000 */ | 81 | #endif /* CONFIG_M32R_NE2000 */ |
93 | 82 | ||
94 | /* MFT2 : system timer */ | 83 | /* MFT2 : system timer */ |
95 | irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; | 84 | set_irq_chip_and_handler(M32R_IRQ_MFT2, &oaks32r_irq_type, |
96 | irq_desc[M32R_IRQ_MFT2].chip = &oaks32r_irq_type; | 85 | handle_level_irq); |
97 | irq_desc[M32R_IRQ_MFT2].action = 0; | ||
98 | irq_desc[M32R_IRQ_MFT2].depth = 1; | ||
99 | icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; | 86 | icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; |
100 | disable_oaks32r_irq(M32R_IRQ_MFT2); | 87 | disable_oaks32r_irq(M32R_IRQ_MFT2); |
101 | 88 | ||
102 | #ifdef CONFIG_SERIAL_M32R_SIO | 89 | #ifdef CONFIG_SERIAL_M32R_SIO |
103 | /* SIO0_R : uart receive data */ | 90 | /* SIO0_R : uart receive data */ |
104 | irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; | 91 | set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &oaks32r_irq_type, |
105 | irq_desc[M32R_IRQ_SIO0_R].chip = &oaks32r_irq_type; | 92 | handle_level_irq); |
106 | irq_desc[M32R_IRQ_SIO0_R].action = 0; | ||
107 | irq_desc[M32R_IRQ_SIO0_R].depth = 1; | ||
108 | icu_data[M32R_IRQ_SIO0_R].icucr = 0; | 93 | icu_data[M32R_IRQ_SIO0_R].icucr = 0; |
109 | disable_oaks32r_irq(M32R_IRQ_SIO0_R); | 94 | disable_oaks32r_irq(M32R_IRQ_SIO0_R); |
110 | 95 | ||
111 | /* SIO0_S : uart send data */ | 96 | /* SIO0_S : uart send data */ |
112 | irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; | 97 | set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &oaks32r_irq_type, |
113 | irq_desc[M32R_IRQ_SIO0_S].chip = &oaks32r_irq_type; | 98 | handle_level_irq); |
114 | irq_desc[M32R_IRQ_SIO0_S].action = 0; | ||
115 | irq_desc[M32R_IRQ_SIO0_S].depth = 1; | ||
116 | icu_data[M32R_IRQ_SIO0_S].icucr = 0; | 99 | icu_data[M32R_IRQ_SIO0_S].icucr = 0; |
117 | disable_oaks32r_irq(M32R_IRQ_SIO0_S); | 100 | disable_oaks32r_irq(M32R_IRQ_SIO0_S); |
118 | 101 | ||
119 | /* SIO1_R : uart receive data */ | 102 | /* SIO1_R : uart receive data */ |
120 | irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; | 103 | set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &oaks32r_irq_type, |
121 | irq_desc[M32R_IRQ_SIO1_R].chip = &oaks32r_irq_type; | 104 | handle_level_irq); |
122 | irq_desc[M32R_IRQ_SIO1_R].action = 0; | ||
123 | irq_desc[M32R_IRQ_SIO1_R].depth = 1; | ||
124 | icu_data[M32R_IRQ_SIO1_R].icucr = 0; | 105 | icu_data[M32R_IRQ_SIO1_R].icucr = 0; |
125 | disable_oaks32r_irq(M32R_IRQ_SIO1_R); | 106 | disable_oaks32r_irq(M32R_IRQ_SIO1_R); |
126 | 107 | ||
127 | /* SIO1_S : uart send data */ | 108 | /* SIO1_S : uart send data */ |
128 | irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; | 109 | set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &oaks32r_irq_type, |
129 | irq_desc[M32R_IRQ_SIO1_S].chip = &oaks32r_irq_type; | 110 | handle_level_irq); |
130 | irq_desc[M32R_IRQ_SIO1_S].action = 0; | ||
131 | irq_desc[M32R_IRQ_SIO1_S].depth = 1; | ||
132 | icu_data[M32R_IRQ_SIO1_S].icucr = 0; | 111 | icu_data[M32R_IRQ_SIO1_S].icucr = 0; |
133 | disable_oaks32r_irq(M32R_IRQ_SIO1_S); | 112 | disable_oaks32r_irq(M32R_IRQ_SIO1_S); |
134 | #endif /* CONFIG_SERIAL_M32R_SIO */ | 113 | #endif /* CONFIG_SERIAL_M32R_SIO */ |