Skip to content

Commit

Permalink
powerpc/mpic: add irq_set_wake support
Browse files Browse the repository at this point in the history
Add irq_set_wake support. Just add IRQF_NO_SUSPEND to desc->action->flag.
So the wake up interrupt will not be disable in suspend_device_irqs.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
  • Loading branch information
Dongsheng.wang@freescale.com authored and Scott Wood committed Jul 1, 2013
1 parent 9837b43 commit 5ff04b7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,22 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type)
return IRQ_SET_MASK_OK_NOCOPY;
}

static int mpic_irq_set_wake(struct irq_data *d, unsigned int on)
{
struct irq_desc *desc = container_of(d, struct irq_desc, irq_data);
struct mpic *mpic = mpic_from_irq_data(d);

if (!(mpic->flags & MPIC_FSL))
return -ENXIO;

if (on)
desc->action->flags |= IRQF_NO_SUSPEND;
else
desc->action->flags &= ~IRQF_NO_SUSPEND;

return 0;
}

void mpic_set_vector(unsigned int virq, unsigned int vector)
{
struct mpic *mpic = mpic_from_irq(virq);
Expand Down Expand Up @@ -957,6 +973,7 @@ static struct irq_chip mpic_irq_chip = {
.irq_unmask = mpic_unmask_irq,
.irq_eoi = mpic_end_irq,
.irq_set_type = mpic_set_irq_type,
.irq_set_wake = mpic_irq_set_wake,
};

#ifdef CONFIG_SMP
Expand All @@ -971,6 +988,7 @@ static struct irq_chip mpic_tm_chip = {
.irq_mask = mpic_mask_tm,
.irq_unmask = mpic_unmask_tm,
.irq_eoi = mpic_end_irq,
.irq_set_wake = mpic_irq_set_wake,
};

#ifdef CONFIG_MPIC_U3_HT_IRQS
Expand Down

0 comments on commit 5ff04b7

Please sign in to comment.