diff options
author | Imre Deak <imre.deak@nokia.com> | 2006-04-11 23:44:05 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-11 23:44:05 -0400 |
commit | c9e617a563ad646239270fa2222cdb06966cf1fa (patch) | |
tree | 7598f9bc96914b4540b1d682eb2e9876343c272a /include | |
parent | 7de90a8cb9c51145d7f60d8db17ce0fa07d1b281 (diff) | |
download | op-kernel-dev-c9e617a563ad646239270fa2222cdb06966cf1fa.zip op-kernel-dev-c9e617a563ad646239270fa2222cdb06966cf1fa.tar.gz |
Input: 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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/spi/ads7846.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 3f76649..d8823e2 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h @@ -17,5 +17,7 @@ struct ads7846_platform_data { u16 debounce_max; /* max number of readings per sample */ u16 debounce_tol; /* tolerance used for filtering */ + + int (*get_pendown_state)(void); }; |