diff options
Diffstat (limited to 'arch/powerpc/sysdev/i8259.c')
-rw-r--r-- | arch/powerpc/sysdev/i8259.c | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index 6323e70e6bf4..d18bb27e4df9 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
@@ -78,19 +78,19 @@ unsigned int i8259_irq(void) | |||
78 | return irq; | 78 | return irq; |
79 | } | 79 | } |
80 | 80 | ||
81 | static void i8259_mask_and_ack_irq(unsigned int irq_nr) | 81 | static void i8259_mask_and_ack_irq(struct irq_data *d) |
82 | { | 82 | { |
83 | unsigned long flags; | 83 | unsigned long flags; |
84 | 84 | ||
85 | raw_spin_lock_irqsave(&i8259_lock, flags); | 85 | raw_spin_lock_irqsave(&i8259_lock, flags); |
86 | if (irq_nr > 7) { | 86 | if (d->irq > 7) { |
87 | cached_A1 |= 1 << (irq_nr-8); | 87 | cached_A1 |= 1 << (d->irq-8); |
88 | inb(0xA1); /* DUMMY */ | 88 | inb(0xA1); /* DUMMY */ |
89 | outb(cached_A1, 0xA1); | 89 | outb(cached_A1, 0xA1); |
90 | outb(0x20, 0xA0); /* Non-specific EOI */ | 90 | outb(0x20, 0xA0); /* Non-specific EOI */ |
91 | outb(0x20, 0x20); /* Non-specific EOI to cascade */ | 91 | outb(0x20, 0x20); /* Non-specific EOI to cascade */ |
92 | } else { | 92 | } else { |
93 | cached_21 |= 1 << irq_nr; | 93 | cached_21 |= 1 << d->irq; |
94 | inb(0x21); /* DUMMY */ | 94 | inb(0x21); /* DUMMY */ |
95 | outb(cached_21, 0x21); | 95 | outb(cached_21, 0x21); |
96 | outb(0x20, 0x20); /* Non-specific EOI */ | 96 | outb(0x20, 0x20); /* Non-specific EOI */ |
@@ -104,42 +104,42 @@ static void i8259_set_irq_mask(int irq_nr) | |||
104 | outb(cached_21,0x21); | 104 | outb(cached_21,0x21); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void i8259_mask_irq(unsigned int irq_nr) | 107 | static void i8259_mask_irq(struct irq_data *d) |
108 | { | 108 | { |
109 | unsigned long flags; | 109 | unsigned long flags; |
110 | 110 | ||
111 | pr_debug("i8259_mask_irq(%d)\n", irq_nr); | 111 | pr_debug("i8259_mask_irq(%d)\n", d->irq); |
112 | 112 | ||
113 | raw_spin_lock_irqsave(&i8259_lock, flags); | 113 | raw_spin_lock_irqsave(&i8259_lock, flags); |
114 | if (irq_nr < 8) | 114 | if (d->irq < 8) |
115 | cached_21 |= 1 << irq_nr; | 115 | cached_21 |= 1 << d->irq; |
116 | else | 116 | else |
117 | cached_A1 |= 1 << (irq_nr-8); | 117 | cached_A1 |= 1 << (d->irq-8); |
118 | i8259_set_irq_mask(irq_nr); | 118 | i8259_set_irq_mask(d->irq); |
119 | raw_spin_unlock_irqrestore(&i8259_lock, flags); | 119 | raw_spin_unlock_irqrestore(&i8259_lock, flags); |
120 | } | 120 | } |
121 | 121 | ||
122 | static void i8259_unmask_irq(unsigned int irq_nr) | 122 | static void i8259_unmask_irq(struct irq_data *d) |
123 | { | 123 | { |
124 | unsigned long flags; | 124 | unsigned long flags; |
125 | 125 | ||
126 | pr_debug("i8259_unmask_irq(%d)\n", irq_nr); | 126 | pr_debug("i8259_unmask_irq(%d)\n", d->irq); |
127 | 127 | ||
128 | raw_spin_lock_irqsave(&i8259_lock, flags); | 128 | raw_spin_lock_irqsave(&i8259_lock, flags); |
129 | if (irq_nr < 8) | 129 | if (d->irq < 8) |
130 | cached_21 &= ~(1 << irq_nr); | 130 | cached_21 &= ~(1 << d->irq); |
131 | else | 131 | else |
132 | cached_A1 &= ~(1 << (irq_nr-8)); | 132 | cached_A1 &= ~(1 << (d->irq-8)); |
133 | i8259_set_irq_mask(irq_nr); | 133 | i8259_set_irq_mask(d->irq); |
134 | raw_spin_unlock_irqrestore(&i8259_lock, flags); | 134 | raw_spin_unlock_irqrestore(&i8259_lock, flags); |
135 | } | 135 | } |
136 | 136 | ||
137 | static struct irq_chip i8259_pic = { | 137 | static struct irq_chip i8259_pic = { |
138 | .name = "i8259", | 138 | .name = "i8259", |
139 | .mask = i8259_mask_irq, | 139 | .irq_mask = i8259_mask_irq, |
140 | .disable = i8259_mask_irq, | 140 | .irq_disable = i8259_mask_irq, |
141 | .unmask = i8259_unmask_irq, | 141 | .irq_unmask = i8259_unmask_irq, |
142 | .mask_ack = i8259_mask_and_ack_irq, | 142 | .irq_mask_ack = i8259_mask_and_ack_irq, |
143 | }; | 143 | }; |
144 | 144 | ||
145 | static struct resource pic1_iores = { | 145 | static struct resource pic1_iores = { |
@@ -175,28 +175,16 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq, | |||
175 | 175 | ||
176 | /* We block the internal cascade */ | 176 | /* We block the internal cascade */ |
177 | if (hw == 2) | 177 | if (hw == 2) |
178 | irq_to_desc(virq)->status |= IRQ_NOREQUEST; | 178 | irq_set_status_flags(virq, IRQ_NOREQUEST); |
179 | 179 | ||
180 | /* We use the level handler only for now, we might want to | 180 | /* We use the level handler only for now, we might want to |
181 | * be more cautious here but that works for now | 181 | * be more cautious here but that works for now |
182 | */ | 182 | */ |
183 | irq_to_desc(virq)->status |= IRQ_LEVEL; | 183 | irq_set_status_flags(virq, IRQ_LEVEL); |
184 | set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq); | 184 | irq_set_chip_and_handler(virq, &i8259_pic, handle_level_irq); |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | static void i8259_host_unmap(struct irq_host *h, unsigned int virq) | ||
189 | { | ||
190 | /* Make sure irq is masked in hardware */ | ||
191 | i8259_mask_irq(virq); | ||
192 | |||
193 | /* remove chip and handler */ | ||
194 | set_irq_chip_and_handler(virq, NULL, NULL); | ||
195 | |||
196 | /* Make sure it's completed */ | ||
197 | synchronize_irq(virq); | ||
198 | } | ||
199 | |||
200 | static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, | 188 | static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, |
201 | const u32 *intspec, unsigned int intsize, | 189 | const u32 *intspec, unsigned int intsize, |
202 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) | 190 | irq_hw_number_t *out_hwirq, unsigned int *out_flags) |
@@ -220,7 +208,6 @@ static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, | |||
220 | static struct irq_host_ops i8259_host_ops = { | 208 | static struct irq_host_ops i8259_host_ops = { |
221 | .match = i8259_host_match, | 209 | .match = i8259_host_match, |
222 | .map = i8259_host_map, | 210 | .map = i8259_host_map, |
223 | .unmap = i8259_host_unmap, | ||
224 | .xlate = i8259_host_xlate, | 211 | .xlate = i8259_host_xlate, |
225 | }; | 212 | }; |
226 | 213 | ||