All of lore.kernel.org
 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 v3 1/3] ads7846: don't report pressure for ads7845
Date: Fri, 12 Aug 2022 10:42:46 +0200	[thread overview]
Message-ID: <20220812084248.9270-2-l.ellero@asem.it> (raw)
In-Reply-To: <20220812084248.9270-1-l.ellero@asem.it>

ADS7845 doesn't support pressure.
This patch avoids the following error reported by libinput-list-devices:
"ADS7845 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE".

Signed-off-by: Luca Ellero <l.ellero@asem.it>
---
 drivers/input/touchscreen/ads7846.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index bed68a68f330..24605c40d039 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1316,8 +1316,9 @@ static int ads7846_probe(struct spi_device *spi)
 			pdata->y_min ? : 0,
 			pdata->y_max ? : MAX_12BIT,
 			0, 0);
-	input_set_abs_params(input_dev, ABS_PRESSURE,
-			pdata->pressure_min, pdata->pressure_max, 0, 0);
+	if (ts->model != 7845)
+		input_set_abs_params(input_dev, ABS_PRESSURE,
+				pdata->pressure_min, pdata->pressure_max, 0, 0);
 
 	/*
 	 * Parse common framework properties. Must be done here to ensure the
-- 
2.25.1


  reply	other threads:[~2022-08-12  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12  8:42 [PATCH v3 0/3] ads7846: fix support for ADS7845 Luca Ellero
2022-08-12  8:42 ` Luca Ellero [this message]
2022-08-12  8:42 ` [PATCH v3 2/3] ads7846: always set last command to PWRDOWN Luca Ellero
2022-08-12  8:42 ` [PATCH v3 3/3] ads7846: don't check penirq immediately for 7845 Luca Ellero
2022-08-23 14:26 ` [PATCH v3 0/3] ads7846: fix support for ADS7845 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=20220812084248.9270-2-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 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.