Re: [PATCH 06/11] mfd: flexcard: add DMA interrupt domain
From: Lee Jones
Date: Mon Mar 30 2015 - 04:50:41 EST
On Wed, 25 Mar 2015, Holger Dengler wrote:
> From: Benedikt Spranger <b.spranger@xxxxxxxxxxxxx>
>
> 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 <dengler@xxxxxxxxxxxxx>
> Signed-off-by: Benedikt Spranger <b.spranger@xxxxxxxxxxxxx>
> cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
> cc: Lee Jones <lee.jones@xxxxxxxxxx>
> ---
> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/