Re: OMAP5912 touchscreen irq not working

Imre Deak
2006-05-31T16:46:31Z

On Wed, 2006-05-31 at 09:05 -0700, ext David Brownell wrote:
> On Wednesday 31 May 2006 8:44 am, Dirk Behme wrote:
> > I think it's wrong to get ads7846_irq() called already while
> > init without screen touched? And then this irq seems to be
> > locked after first touch.
>
> Locking out after first touch is a problem, of course.
>
> IRQ during init happens with some hardware; I recall
> concluding it wasn't a problem here, though the details
> of that have been discarded like a used coffee filter.
>
> ISTR one issue is that sampling will trigger an IRQ,
> so the driver needs to throttle the IRQs.

Yes, during init we send send a couple of commands - with IRQs disabled
- to put the device in the initial waiting-for-IRQ state. That will also
result in a latched interrupt which will be delivered as soon as we
enable the IRQ again.

This spurious IRQ could be avoided by set_irq_type(IRQT_NONE) which
would prevent even the latching of it.

In the current code this shouldn't be a problem, since in the IRQ
handler we check the actual pen status.

> > Please correct me if I'm wrong here, but with irq called at
> > init without screen touched, then after one touch locked,
> > and permanently called ads7846_rx() throwing away all
> > samples, it seems to me that there is anything basically
> > wrong with this new code? At least on OSK with mistral.
>
> There were glitches related to the problem with irqs not
> getting disabled on request, with comments along the lines
> of "remove this when the irqs work right" ... I think it's
> time to maybe sort that issue out.

Yes, I think the irq_disabled flag is not necessary any more.

> That said, this problem did not exist before the GPIO IRQ
> patches were merged ... I certainly saw correct IRQ behavior
> from my testing.

Might be, but this looks more to me to do something with values returned
to the _rx() function. Since it's continually called I suppose it never
detects the pen up which it determines from the pressure value. Would
help if you could enable the pr_debug in the _rx() function to see the
returned values.

--Imre

>
> - Dave