All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jason77.wang@gmail.com>
To: dmitry.torokhov@gmail.com, notasas@gmail.com, vapier@gentoo.org
Cc: linux-input@vger.kernel.org
Subject: [PATCH 3/4] Input: ads7846 - restore ADC to powerdown mode if no messgaes needed
Date: Thu, 16 Sep 2010 18:51:25 +0800	[thread overview]
Message-ID: <1284634286-8871-4-git-send-email-jason77.wang@gmail.com> (raw)
In-Reply-To: <1284634286-8871-3-git-send-email-jason77.wang@gmail.com>

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 <jason77.wang@gmail.com>
---
 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


  reply	other threads:[~2010-09-16 10:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16 10:51 [PATCH 0/4] Switch ads7846 driver to use soft irq Jason Wang
2010-09-16 10:51 ` [PATCH 1/4] Input: ads7846 - switch to using threaded IRQ Jason Wang
2010-09-16 10:51   ` [PATCH 2/4] Input: ads7846 - add a include header to prevent building fails Jason Wang
2010-09-16 10:51     ` Jason Wang [this message]
2010-09-16 10:51       ` [PATCH 4/4] Input: ads7846 - modificatons of _stop()/_disable() conditions Jason Wang
2010-09-17  6:39         ` Dmitry Torokhov
2010-09-17  9:20           ` Jason Wang
2010-09-17 16:07             ` Dmitry Torokhov
2010-09-20  8:18               ` Jason Wang
2010-10-12  9:58                 ` Jason Wang
2010-10-12 16:00                   ` Dmitry Torokhov
2010-10-13  3:12                     ` Jason Wang
2010-10-13 22:17                       ` Grazvydas Ignotas
2010-10-14  2:14                         ` Jason Wang
2010-10-14 21:40                           ` Grazvydas Ignotas
2010-10-15  2:29                             ` Jason Wang
2010-10-18 23:19                               ` Tony Lindgren
2010-10-19  1:25                                 ` Jason Wang
2010-09-17  1:48 ` [PATCH 0/4] Switch ads7846 driver to use soft irq Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284634286-8871-4-git-send-email-jason77.wang@gmail.com \
    --to=jason77.wang@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=notasas@gmail.com \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.