Re: OMAP5912 touchscreen irq not working

Dirk Behme
2006-05-31T15:44:12Z

>Imre Deak wrote:
>> ext David Brownell wrote:
>>Unlikely; it worked before, why would it stop working suddenly?
>>Including with the previous SPI clock... it's some other change
>>causing the breakage.
>
> Yes, if it worked before with the wrong clock it's probably something else.

Had a look to it and added some debug printks to ads7846.c.
One in ads7846_irq() and two in ads7846_rx(). There, one
before check if samples to be thrown away, one behind (see
below).

Looking at ads7846_irq(), while initalization, I get
"ads7846 spi2.0: touchscreen + hwmon, irq 164"

With this irq, I only get two outputs of "ads_irq". The
first directly while initialization (without touching the
screen), the second at first screen touch. Then nothing,
regardless how often I touch the screen again. This is
reflected by /proc/interrupts as well: 164: 2 spi2.0. 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.

Looking at ads7846_rx, I permanently get "ads7846_rx
called". But never "ads7846_rx valid sample". Is it correct
to call ads7846_rx permanently? Shouldn't ads7846_rx() be
called only while pen is down?

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.

Best regards

Dirk

--- ./drivers/input/touchscreen/ads7846.c_orig 2006-05-31
16:57:46.000000000 +0200
+++ ./drivers/input/touchscreen/ads7846.c 2006-05-31
17:23:52.000000000 +0200
@@ -410,6 +410,8 @@ static void ads7846_rx(void *ads)
} else
Rt = 0;

+ printk("### ads7846_rx called\n");
+
/* Sample found inconsistent by debouncing or
pressure is beyond
* the maximum. Don't report it to user space,
repeat at least
* once more the measurement */
@@ -418,6 +420,8 @@ static void ads7846_rx(void *ads)
return;
}

+ printk("### ads7846_rx valid sample\n");
+
/* NOTE: "pendown" is inferred from pressure; we
don't rely on
* being able to check nPENIRQ status, or
"friendly" trigger modes
* (both-edges is much better than just-falling or
low-level).
@@ -543,6 +547,8 @@ static irqreturn_t ads7846_irq(int irq,
struct ads7846 *ts = handle;
unsigned long flags;

+ printk("ads_irq\n");
+
spin_lock_irqsave(&ts->lock, flags);
if (likely(ts->get_pendown_state())) {
if (!ts->irq_disabled) {