* [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers [not found] <20240618124018.3303162-1-sashal@kernel.org> @ 2024-06-18 12:39 ` Sasha Levin 2024-07-10 9:58 ` Pavel Machek 2024-06-18 12:39 ` [PATCH AUTOSEL 6.1 29/29] HID: Ignore battery for ELAN touchscreens 2F2C and 4116 Sasha Levin 1 sibling, 1 reply; 6+ messages in thread From: Sasha Levin @ 2024-06-18 12:39 UTC (permalink / raw) To: linux-kernel, stable Cc: Hans de Goede, Dmitry Torokhov, Sasha Levin, linux-input, platform-driver-x86 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers 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 0 siblings, 1 reply; 6+ messages in thread From: Pavel Machek @ 2024-07-10 9:58 UTC (permalink / raw) To: Sasha Levin Cc: linux-kernel, stable, Hans de Goede, Dmitry Torokhov, linux-input, platform-driver-x86 [-- Attachment #1: Type: text/plain, Size: 1065 bytes --] Hi! > 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. This does not fix a serious bug, should not be in stable. Best regards, Pavel -- People of Russia, stop Putin before his war on Ukraine escalates. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers 2024-07-10 9:58 ` Pavel Machek @ 2024-07-10 9:59 ` Hans de Goede 2024-07-10 11:55 ` Pavel Machek 0 siblings, 1 reply; 6+ messages in thread From: Hans de Goede @ 2024-07-10 9:59 UTC (permalink / raw) To: Pavel Machek, Sasha Levin Cc: linux-kernel, stable, Dmitry Torokhov, linux-input, platform-driver-x86 Hi Pavel, On 7/10/24 11:58 AM, Pavel Machek wrote: > Hi! > >> 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. > > This does not fix a serious bug, should not be in stable. This patch is necessary for clean backporting of new DMI quirks added to drivers/platform/x86/touchscreen_dmi.c, so IMHO it does make sense as a stable series patch. Regards, Hans ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers 2024-07-10 9:59 ` Hans de Goede @ 2024-07-10 11:55 ` Pavel Machek 0 siblings, 0 replies; 6+ messages in thread From: Pavel Machek @ 2024-07-10 11:55 UTC (permalink / raw) To: Hans de Goede Cc: Sasha Levin, linux-kernel, stable, Dmitry Torokhov, linux-input, platform-driver-x86 [-- Attachment #1: Type: text/plain, Size: 1532 bytes --] On Wed 2024-07-10 11:59:48, Hans de Goede wrote: > Hi Pavel, > > On 7/10/24 11:58 AM, Pavel Machek wrote: > > Hi! > > > >> 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. > > > > This does not fix a serious bug, should not be in stable. > > This patch is necessary for clean backporting of new DMI quirks added > to drivers/platform/x86/touchscreen_dmi.c, so IMHO it does make sense > as a stable series patch. That's likely not reason it ended up it autosel, but why not. "Stable-dep-of" tag would be nice in that case. Best regards, Pavel -- People of Russia, stop Putin before his war on Ukraine escalates. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH AUTOSEL 6.1 29/29] HID: Ignore battery for ELAN touchscreens 2F2C and 4116 [not found] <20240618124018.3303162-1-sashal@kernel.org> 2024-06-18 12:39 ` [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers Sasha Levin @ 2024-06-18 12:39 ` Sasha Levin 1 sibling, 0 replies; 6+ messages in thread From: Sasha Levin @ 2024-06-18 12:39 UTC (permalink / raw) To: linux-kernel, stable Cc: Louis Dalibard, Jiri Kosina, Sasha Levin, jikos, bentiss, linux-input From: Louis Dalibard <ontake@ontake.dev> [ Upstream commit a3a5a37efba11b7cf1a86abe7bccfbcdb521764e ] At least ASUS Zenbook 14 (2023) and ASUS Zenbook 14 Pro (2023) are affected. The touchscreen reports a battery status of 0% and jumps to 1% when a stylus is used. The device ID was added and the battery ignore quirk was enabled for it. [jkosina@suse.com: reformatted changelog a bit] Signed-off-by: Louis Dalibard <ontake@ontake.dev> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-input.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 405d88b08908d..4b8c1d18c21e0 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -417,6 +417,8 @@ #define I2C_DEVICE_ID_HP_SPECTRE_X360_13_AW0020NG 0x29DF #define I2C_DEVICE_ID_ASUS_TP420IA_TOUCHSCREEN 0x2BC8 #define I2C_DEVICE_ID_ASUS_GV301RA_TOUCHSCREEN 0x2C82 +#define I2C_DEVICE_ID_ASUS_UX3402_TOUCHSCREEN 0x2F2C +#define I2C_DEVICE_ID_ASUS_UX6404_TOUCHSCREEN 0x4116 #define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544 #define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706 #define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 4ba5df3c1e039..b0091819fd58a 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -374,6 +374,10 @@ static const struct hid_device_id hid_battery_quirks[] = { HID_BATTERY_QUIRK_IGNORE }, { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_ASUS_GV301RA_TOUCHSCREEN), HID_BATTERY_QUIRK_IGNORE }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_ASUS_UX3402_TOUCHSCREEN), + HID_BATTERY_QUIRK_IGNORE }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_ASUS_UX6404_TOUCHSCREEN), + HID_BATTERY_QUIRK_IGNORE }, { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN), HID_BATTERY_QUIRK_IGNORE }, { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN), -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <20240617132456.2588952-1-sashal@kernel.org>]
* [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers [not found] <20240617132456.2588952-1-sashal@kernel.org> @ 2024-06-17 13:24 ` Sasha Levin 0 siblings, 0 replies; 6+ messages in thread From: Sasha Levin @ 2024-06-17 13:24 UTC (permalink / raw) To: linux-kernel, stable Cc: Hans de Goede, Dmitry Torokhov, Sasha Levin, linux-input, platform-driver-x86 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-10 11:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240618124018.3303162-1-sashal@kernel.org>
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
2024-06-18 12:39 ` [PATCH AUTOSEL 6.1 29/29] HID: Ignore battery for ELAN touchscreens 2F2C and 4116 Sasha Levin
[not found] <20240617132456.2588952-1-sashal@kernel.org>
2024-06-17 13:24 ` [PATCH AUTOSEL 6.1 23/29] Input: silead - Always support 10 fingers Sasha Levin
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).