]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[PATCH 4/6] ads7846: handle IRQs that were latched during disabled IRQs
authorImre Deak <imre.deak@nokia.com>
Mon, 15 May 2006 07:37:59 +0000 (00:37 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 15 May 2006 07:37:59 +0000 (00:37 -0700)
commit5656308fac44c0d2e097d1180fbf4e28c028acb7
tree1ffbf73ccbff14e4bf8ab604d6938d7bc1b68e28
parent36350e2973b72a651f10af9b4df644e683b4d7ce
[PATCH 4/6] ads7846: handle IRQs that were latched during disabled IRQs

The pen down IRQ will toggle during each X,Y,Z measurement cycle.
Even though the IRQ is disabled it will be latched and delivered
when after enable_irq. Thus in the IRQ handler we must avoid
starting a new measurement cycle when such an "unwanted" IRQ happens.
Add a get_pendown_state platform function, which will probably
determine this by reading the current GPIO level of the pen IRQ pin.

Move the IRQ reenabling from the SPI RX function to the timer. After
the last power down message the pen IRQ pin is still active for a
while and get_pendown_state would report incorrectly a pen down state.

When suspending we should check the ts->pending flag instead of
ts->pendown, since the timer can be pending regardless of ts->pendown.
Also if ts->pending is set we can be sure that the timer is running,
so no need to rearm it. Similarly if ts->pending is not set we can
be sure that the IRQ is enabled (and the timer is not).

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/ads7846.c
include/linux/spi/ads7846.h