public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers
Date: Mon, 17 Jun 2024 09:24:27 -0400	[thread overview]
Message-ID: <20240617132456.2588952-23-sashal@kernel.org> (raw)
In-Reply-To: <20240617132456.2588952-1-sashal@kernel.org>

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 38a38f5a36da9820680d413972cb733349400532 ]

When support for Silead touchscreens was orginal added some touchscreens
with older firmware versions only supported 5 fingers and this was made
the default requiring the setting of a "silead,max-fingers=10" uint32
device-property for all touchscreen models which do support 10 fingers.

There are very few models with the old 5 finger fw, so in practice the
setting of the "silead,max-fingers=10" is boilerplate which needs to
be copy and pasted to every touchscreen config.

Reporting that 10 fingers are supported on devices which only support
5 fingers doesn't cause any problems for userspace in practice, since
at max 4 finger gestures are supported anyways. Drop the max_fingers
configuration and simply always assume 10 fingers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20240525193854.39130-2-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/input/touchscreen/silead.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 3eef8c01090fd..30e15b6a93574 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -71,7 +71,6 @@ struct silead_ts_data {
 	struct regulator_bulk_data regulators[2];
 	char fw_name[64];
 	struct touchscreen_properties prop;
-	u32 max_fingers;
 	u32 chip_id;
 	struct input_mt_pos pos[SILEAD_MAX_FINGERS];
 	int slots[SILEAD_MAX_FINGERS];
@@ -136,7 +135,7 @@ static int silead_ts_request_input_dev(struct silead_ts_data *data)
 	touchscreen_parse_properties(data->input, true, &data->prop);
 	silead_apply_efi_fw_min_max(data);
 
-	input_mt_init_slots(data->input, data->max_fingers,
+	input_mt_init_slots(data->input, SILEAD_MAX_FINGERS,
 			    INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED |
 			    INPUT_MT_TRACK);
 
@@ -256,10 +255,10 @@ static void silead_ts_read_data(struct i2c_client *client)
 		return;
 	}
 
-	if (buf[0] > data->max_fingers) {
+	if (buf[0] > SILEAD_MAX_FINGERS) {
 		dev_warn(dev, "More touches reported then supported %d > %d\n",
-			 buf[0], data->max_fingers);
-		buf[0] = data->max_fingers;
+			 buf[0], SILEAD_MAX_FINGERS);
+		buf[0] = SILEAD_MAX_FINGERS;
 	}
 
 	if (silead_ts_handle_pen_data(data, buf))
@@ -315,7 +314,6 @@ static void silead_ts_read_data(struct i2c_client *client)
 
 static int silead_ts_init(struct i2c_client *client)
 {
-	struct silead_ts_data *data = i2c_get_clientdata(client);
 	int error;
 
 	error = i2c_smbus_write_byte_data(client, SILEAD_REG_RESET,
@@ -325,7 +323,7 @@ static int silead_ts_init(struct i2c_client *client)
 	usleep_range(SILEAD_CMD_SLEEP_MIN, SILEAD_CMD_SLEEP_MAX);
 
 	error = i2c_smbus_write_byte_data(client, SILEAD_REG_TOUCH_NR,
-					data->max_fingers);
+					  SILEAD_MAX_FINGERS);
 	if (error)
 		goto i2c_write_err;
 	usleep_range(SILEAD_CMD_SLEEP_MIN, SILEAD_CMD_SLEEP_MAX);
@@ -591,13 +589,6 @@ static void silead_ts_read_props(struct i2c_client *client)
 	const char *str;
 	int error;
 
-	error = device_property_read_u32(dev, "silead,max-fingers",
-					 &data->max_fingers);
-	if (error) {
-		dev_dbg(dev, "Max fingers read error %d\n", error);
-		data->max_fingers = 5; /* Most devices handle up-to 5 fingers */
-	}
-
 	error = device_property_read_string(dev, "firmware-name", &str);
 	if (!error)
 		snprintf(data->fw_name, sizeof(data->fw_name),
-- 
2.43.0


  parent reply	other threads:[~2024-06-17 13:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 13:24 [PATCH AUTOSEL 6.1 01/29] scsi: core: alua: I/O errors for ALUA state transitions Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 02/29] scsi: sr: Fix unintentional arithmetic wraparound Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 03/29] scsi: qedf: Don't process stag work during unload and recovery Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 04/29] scsi: qedf: Wait for stag work during unload Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 05/29] scsi: qedf: Set qed_slowpath_params to zero before use Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 06/29] efi/libstub: zboot.lds: Discard .discard sections Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 07/29] efi: pstore: Return proper errors on UEFI failures Sasha Levin
2024-06-17 15:16   ` Guilherme G. Piccoli
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 08/29] ACPI: EC: Abort address space access upon error Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 09/29] ACPI: EC: Avoid returning AE_OK on errors in address space handler Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 10/29] tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 11/29] wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 12/29] wifi: mac80211: apply mcast rate only if interface is up Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 13/29] wifi: mac80211: handle tasklet frames before stopping Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 14/29] wifi: cfg80211: fix 6 GHz scan request building Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 15/29] wifi: iwlwifi: mvm: d3: fix WoWLAN command version lookup Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 16/29] wifi: iwlwifi: mvm: Handle BIGTK cipher in kek_kck cmd Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 17/29] wifi: iwlwifi: mvm: properly set 6 GHz channel direct probe option Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 18/29] wifi: iwlwifi: mvm: Fix scan abort handling with HW rfkill Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 19/29] wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan() Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 20/29] selftests/openat2: Fix build warnings on ppc64 Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 21/29] selftests/futex: pass _GNU_SOURCE without a value to the compiler Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 22/29] of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw() Sasha Levin
2024-06-17 13:24 ` Sasha Levin [this message]
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 24/29] net: ipv6: rpl_iptunnel: block BH in rpl_output() and rpl_input() Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 25/29] ila: block BH in ila_output() Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 26/29] null_blk: fix validation of block size Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 27/29] kconfig: gconf: give a proper initial state to the Save button Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 28/29] kconfig: remove wrong expr_trans_bool() Sasha Levin
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 29/29] HID: Ignore battery for ELAN touchscreens 2F2C and 4116 Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18 12:39 [PATCH AUTOSEL 6.1 01/29] scsi: core: alua: I/O errors for ALUA state transitions Sasha Levin
2024-06-18 12:39 ` [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers Sasha Levin
2024-07-10  9:58   ` Pavel Machek
2024-07-10  9:59     ` Hans de Goede
2024-07-10 11:55       ` Pavel Machek

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=20240617132456.2588952-23-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox