On Wed, 25 Mar 2015, Holger Dengler wrote:

> From: Benedikt Spranger <b.spran...@linutronix.de>
> 
> The Flexcard comprise an interrupt controller for the attached
> tinys, timer, a Flexray related trigger and a second one for DMA.
> Both controllers share a single IRQ line.
> 
> Add an interrupt domain for the DMA Controller interrupts.
> 
> Signed-off-by: Holger Dengler <deng...@linutronix.de>
> Signed-off-by: Benedikt Spranger <b.spran...@linutronix.de>
> cc: Samuel Ortiz <sa...@linux.intel.com>
> cc: Lee Jones <lee.jo...@linaro.org>
> ---
>  drivers/mfd/flexcard/irq.c   | 95 
> +++++++++++++++++++++++++++++++++++++++++---
>  drivers/mfd/flexcard/irq.h   | 11 +++++
>  include/linux/mfd/flexcard.h | 23 +++++++++++
>  3 files changed, 124 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/flexcard/irq.c b/drivers/mfd/flexcard/irq.c
> index fefcb24..17e8b2c 100644
> --- a/drivers/mfd/flexcard/irq.c
> +++ b/drivers/mfd/flexcard/irq.c
> @@ -27,11 +27,13 @@
>  static irqreturn_t flexcard_demux(int irq, void *data)
>  {
>       struct flexcard_device *priv = data;
> -     u32 stat;
> +     u32 stat, dma_stat;
>       int i, cur;
>  
>       stat = readl(&priv->conf->irs);
> -     if (!stat)
> +     dma_stat = readl(&priv->conf->dma_irsr);
> +
> +     if (!stat && !dma_stat)
>               return IRQ_NONE;
>  
>       for (i = 0; i < NR_FLEXCARD_IRQ; i++) {
> @@ -41,6 +43,15 @@ static irqreturn_t flexcard_demux(int irq, void *data)
>                               generic_handle_irq(cur);
>               }
>       }
> +
> +     for (i = 0; i < NR_FLEXCARD_DMA_IRQ; i++) {
> +             if (dma_stat & flexcard_dma_irq_tab[i].status) {
> +                     cur = irq_find_mapping(priv->dma_domain, i);
> +                     if (cur)
> +                             generic_handle_irq(cur);
> +             }
> +     }

You might only want to do the top if (stat) and only the second if
(dma_stat).

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to