Messages in this thread | | | Date | Mon, 30 Mar 2015 09:50:30 +0100 | From | Lee Jones <> | Subject | Re: [PATCH 06/11] mfd: flexcard: add DMA interrupt domain |
| |
On Wed, 25 Mar 2015, Holger Dengler wrote:
> From: Benedikt Spranger <b.spranger@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 <dengler@linutronix.de> > Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> > cc: Samuel Ortiz <sameo@linux.intel.com> > cc: Lee Jones <lee.jones@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
| |