lkml.org 
[lkml]   [2013]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/2] input: ti_am335x_tsc: Enable shared IRQ for TSC
* Zubair Lutfullah | 2013-08-25 23:45:23 [+0100]:

>diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
>index e1c5300..4124e580 100644
>--- a/drivers/input/touchscreen/ti_am335x_tsc.c
>+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
>@@ -315,11 +321,17 @@ static irqreturn_t titsc_irq(int irq, void *dev)
> }
>
> if (irqclr) {
>- titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
>- am335x_tsc_se_update(ts_dev->mfd_tscadc);
>- return IRQ_HANDLED;
>+ titsc_writel(ts_dev, REG_IRQSTATUS, (status | irqclr));
>+ am335x_tsc_se_set(ts_dev->mfd_tscadc, ts_dev->step_mask);
> }
>- return IRQ_NONE;
>+
>+ /* If any IRQ flags left, return none. So ADC can handle its IRQs */
>+ status = titsc_readl(ts_dev, REG_IRQSTATUS);
>+ if (status == false)
>+ return IRQ_HANDLED;
>+ else
>+ return IRQ_NONE;

If I understand this correctly you return IRQ_NONE the TSC interrupt has
been handled and no ADC interrupt is outstanding.
This is bad because if you received 1k _only_ TSC interrupts you return
always IRQ_NONE and the irq-core will disable the interrupt line. You
don't want this.

Now, if you handle an interrupt at the TSC level and return IRQ_HANDLED
then the second handler, the ADC in your case, is also invoked.
So you can drop this and return IRQ_HANDLED if you *did* something here
and NONE if didn't do anything.

Basides that, I'm fine with it.

>+
> }

Sebastian


\
 
 \ /
  Last update: 2013-08-28 13:21    [W:0.231 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site