linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Ellero <l.ellero@asem.it>
To: dmitry.torokhov@gmail.com, daniel@zonque.org,
	m.felsch@pengutronix.de, andriy.shevchenko@linux.intel.com,
	u.kleine-koenig@pengutronix.de, mkl@pengutronix.de,
	miquel.raynal@bootlin.com, imre.deak@nokia.com,
	luca.ellero@brickedbrain.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luca Ellero <l.ellero@asem.it>
Subject: [PATCH 3/3] Input: ads7846 - don't check penirq immediately for 7845
Date: Thu, 26 Jan 2023 11:52:27 +0100	[thread overview]
Message-ID: <20230126105227.47648-4-l.ellero@asem.it> (raw)
In-Reply-To: <20230126105227.47648-1-l.ellero@asem.it>

To discard false readings, one should use "ti,penirq-recheck-delay-usecs".
Checking get_pendown_state() at the beginning, most of the time fails
causing malfunctioning.

Fixes: ffa458c1bd9b ("spi: ads7846 driver")
Signed-off-by: Luca Ellero <l.ellero@asem.it>
---
 drivers/input/touchscreen/ads7846.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 15da1047a577..17f11bce8113 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -843,14 +843,8 @@ static void ads7846_report_state(struct ads7846 *ts)
 	if (x == MAX_12BIT)
 		x = 0;
 
-	if (ts->model == 7843) {
+	if (ts->model == 7843 || ts->model == 7845) {
 		Rt = ts->pressure_max / 2;
-	} else if (ts->model == 7845) {
-		if (get_pendown_state(ts))
-			Rt = ts->pressure_max / 2;
-		else
-			Rt = 0;
-		dev_vdbg(&ts->spi->dev, "x/y: %d/%d, PD %d\n", x, y, Rt);
 	} else if (likely(x && z1)) {
 		/* compute touch pressure resistance using equation #2 */
 		Rt = z2;
-- 
2.25.1


  parent reply	other threads:[~2023-01-26 11:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 10:52 [PATCH v5 0/3] Input: ads7846 - fix support for ADS7845 Luca Ellero
2023-01-26 10:52 ` [PATCH 1/3] Input: ads7846 - don't report pressure for ads7845 Luca Ellero
2023-01-26 10:52 ` [PATCH 2/3] Input: ads7846 - always set last command to PWRDOWN Luca Ellero
2023-01-26 10:52 ` Luca Ellero [this message]
2023-01-26 13:06 ` [PATCH v5 0/3] Input: ads7846 - fix support for ADS7845 Andy Shevchenko
2023-01-30  4:35 ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2023-01-20 12:45 [PATCH v4 " Luca Ellero
2023-01-20 12:45 ` [PATCH 3/3] Input: ads7846 - don't check penirq immediately for 7845 Luca Ellero
2023-01-20 15:18   ` Andy Shevchenko

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=20230126105227.47648-4-l.ellero@asem.it \
    --to=l.ellero@asem.it \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=daniel@zonque.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=imre.deak@nokia.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ellero@brickedbrain.com \
    --cc=m.felsch@pengutronix.de \
    --cc=miquel.raynal@bootlin.com \
    --cc=mkl@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).