aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 8ffe164e95ad..bda0e5b8ce21 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -140,7 +140,6 @@ static void cpm2_end_irq(struct irq_data *d)
140static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type) 140static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
141{ 141{
142 unsigned int src = virq_to_hw(d->irq); 142 unsigned int src = virq_to_hw(d->irq);
143 struct irq_desc *desc = irq_to_desc(d->irq);
144 unsigned int vold, vnew, edibit; 143 unsigned int vold, vnew, edibit;
145 144
146 /* Port C interrupts are either IRQ_TYPE_EDGE_FALLING or 145 /* Port C interrupts are either IRQ_TYPE_EDGE_FALLING or
@@ -162,13 +161,11 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
162 goto err_sense; 161 goto err_sense;
163 } 162 }
164 163
165 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); 164 irqd_set_trigger_type(d, flow_type);
166 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; 165 if (flow_type & IRQ_TYPE_LEVEL_LOW)
167 if (flow_type & IRQ_TYPE_LEVEL_LOW) { 166 __set_irq_handler_unlocked(d->irq, handle_level_irq);
168 desc->status |= IRQ_LEVEL; 167 else
169 desc->handle_irq = handle_level_irq; 168 __set_irq_handler_unlocked(d->irq, handle_edge_irq);
170 } else
171 desc->handle_irq = handle_edge_irq;
172 169
173 /* internal IRQ senses are LEVEL_LOW 170 /* internal IRQ senses are LEVEL_LOW
174 * EXT IRQ and Port C IRQ senses are programmable 171 * EXT IRQ and Port C IRQ senses are programmable
@@ -179,7 +176,8 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
179 if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0) 176 if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
180 edibit = (31 - (CPM2_IRQ_PORTC0 - src)); 177 edibit = (31 - (CPM2_IRQ_PORTC0 - src));
181 else 178 else
182 return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL; 179 return (flow_type & IRQ_TYPE_LEVEL_LOW) ?
180 IRQ_SET_MASK_OK_NOCOPY : -EINVAL;
183 181
184 vold = in_be32(&cpm2_intctl->ic_siexr); 182 vold = in_be32(&cpm2_intctl->ic_siexr);
185 183
@@ -190,7 +188,7 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
190 188
191 if (vold != vnew) 189 if (vold != vnew)
192 out_be32(&cpm2_intctl->ic_siexr, vnew); 190 out_be32(&cpm2_intctl->ic_siexr, vnew);
193 return 0; 191 return IRQ_SET_MASK_OK_NOCOPY;
194 192
195err_sense: 193err_sense:
196 pr_err("CPM2 PIC: sense type 0x%x not supported\n", flow_type); 194 pr_err("CPM2 PIC: sense type 0x%x not supported\n", flow_type);