Thread (19 messages) 19 messages, 4 authors, 2010-10-19
STALE5705d

[PATCH 3/4] Input: ads7846 - restore ADC to powerdown mode if no messgaes needed

From: Jason Wang <hidden>
Date: 2010-09-16 10:47:58
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

When the ADC get wrong datas and have to ignore remaining messages in
a transfer turn, we should set ADC to powerdown mode instead of
leaving it at previous operation mode, otherwise we can't get the
correct pendown state and the irq will not trigger any more.

After the last message is transfered, we should add msg_idx to let
the code to skip out the loop.

Signed-off-by: Jason Wang <redacted>
---
 drivers/input/touchscreen/ads7846.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 5ddaeea..eab8b0b 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -729,7 +729,8 @@ static void ads7846_read_state(struct ads7846 *ts)
 
 			case ADS7846_FILTER_IGNORE:
 				packet->tc.ignore = true;
-				return;
+				msg_idx = ts->msg_count - 1;
+				continue;
 
 			case ADS7846_FILTER_OK:
 				ads7846_update_value(m, val);
@@ -740,6 +741,8 @@ static void ads7846_read_state(struct ads7846 *ts)
 			default:
 				BUG();
 			}
+		} else {
+			msg_idx++;
 		}
 	}
 }
-- 
1.5.6.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help