[PATCH v2 1/4] powerpc/mpic: add irq_set_wake support

Scott Wood scottwood at freescale.com
Wed Apr 3 11:36:56 EST 2013


On 04/02/2013 01:40:37 AM, Wang Dongsheng wrote:
> 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 at freescale.com>
> ---
> v2:
> * Add: Check freescale chip in mpic_irq_set_wake().
> * Remove: Support mpic_irq_set_wake() in ht_chip.
> 
>  arch/powerpc/sysdev/mpic.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index 3b2efd4..50d1ee1 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -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 -EINVAL;

I was thinking more along the lines of using MPIC_FSL during init to  
decide whether to write this function to .irq_set_wake, though that  
could probably wait until there's a second type of MPIC that needs this  
(if ever).

-Scott


More information about the Linuxppc-dev mailing list