Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243337
b: refs/heads/master
c: a28ab38
h: refs/heads/master
i:
  243335: e99f283
v: v3
  • Loading branch information
Thomas Gleixner committed Mar 29, 2011
1 parent ccac342 commit 135ebd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00e70bad1abba1f96f7b9e6454b222f393e5281f
refs/heads/master: a28ab38c440d0391d8a3673514e4cfb079445309
18 changes: 8 additions & 10 deletions trunk/arch/powerpc/sysdev/cpm2_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ static void cpm2_end_irq(struct irq_data *d)
static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
{
unsigned int src = virq_to_hw(d->irq);
struct irq_desc *desc = irq_to_desc(d->irq);
unsigned int vold, vnew, edibit;

/* Port C interrupts are either IRQ_TYPE_EDGE_FALLING or
Expand All @@ -162,13 +161,11 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
goto err_sense;
}

desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
if (flow_type & IRQ_TYPE_LEVEL_LOW) {
desc->status |= IRQ_LEVEL;
desc->handle_irq = handle_level_irq;
} else
desc->handle_irq = handle_edge_irq;
irqd_set_trigger_type(d, flow_type);
if (flow_type & IRQ_TYPE_LEVEL_LOW)
__set_irq_handler_unlocked(d->irq, handle_level_irq);
else
__set_irq_handler_unlocked(d->irq, handle_edge_irq);

/* internal IRQ senses are LEVEL_LOW
* EXT IRQ and Port C IRQ senses are programmable
Expand All @@ -179,7 +176,8 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
edibit = (31 - (CPM2_IRQ_PORTC0 - src));
else
return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL;
return (flow_type & IRQ_TYPE_LEVEL_LOW) ?
IRQ_SET_MASK_OK_NOCOPY : -EINVAL;

vold = in_be32(&cpm2_intctl->ic_siexr);

Expand All @@ -190,7 +188,7 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)

if (vold != vnew)
out_be32(&cpm2_intctl->ic_siexr, vnew);
return 0;
return IRQ_SET_MASK_OK_NOCOPY;

err_sense:
pr_err("CPM2 PIC: sense type 0x%x not supported\n", flow_type);
Expand Down

0 comments on commit 135ebd7

Please sign in to comment.