linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REGRESSION] Right touchpad button disabled on Dell 7750
@ 2022-03-18 11:42 Takashi Iwai
  2022-03-18 13:07 ` José Expósito
  0 siblings, 1 reply; 15+ messages in thread
From: Takashi Iwai @ 2022-03-18 11:42 UTC (permalink / raw)
  To: linux-input
  Cc: José Expósito, Peter Hutterer, Benjamin Tissoires,
	Jiri Kosina, stable, regressions, linux-kernel

Hi,

we received a bug report about the regression of the touchpad on Dell
7750 laptop, the right touchpad button is disabled on recent kernels:
  https://bugzilla.suse.com/show_bug.cgi?id=1197243

Note that it's a physical button, not a virtual clickpad button.

The regression seems introduced by the upstream commit
37ef4c19b4c659926ce65a7ac709ceaefb211c40 ("Input: clear
BTN_RIGHT/MIDDLE on buttonpads") that was backported to stable 5.16.x
kernel.

The device is managed by hid-multitouch driver, and the further
investigation revealed that it's rather an incorrectly recognized
buttonpad property; namely, ID_DG_BUTTONTYPE reports it being 0 =
clickable touchpad although it's not.  I built a test kernel to ignore
this check and it was confirmed to make the right button working again
by the reporter.

Is this check really correct in general?  Or do we need some
device-specific quirk?


thanks,

Takashi

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] HID: multitouch: fix Dell Precision 7550 and 7750 button type
@ 2022-03-20 19:06 José Expósito
  2022-03-21  6:29 ` Thorsten Leemhuis
  2022-03-21  9:25 ` Benjamin Tissoires
  0 siblings, 2 replies; 15+ messages in thread
From: José Expósito @ 2022-03-20 19:06 UTC (permalink / raw)
  To: jkosina
  Cc: tiwai, benjamin.tissoires, regressions, peter.hutterer,
	linux-input, stable, regressions, linux-kernel,
	José Expósito

The touchpad present in the Dell Precision 7550 and 7750 laptops
reports a HID_DG_BUTTONTYPE of type MT_BUTTONTYPE_CLICKPAD. However,
the device is not a clickpad, it is a touchpad with physical buttons.

In order to fix this issue, a quirk for the device was introduced in
libinput [1] [2] to disable the INPUT_PROP_BUTTONPAD property:

	[Precision 7x50 Touchpad]
	MatchBus=i2c
	MatchUdevType=touchpad
	MatchDMIModalias=dmi:*svnDellInc.:pnPrecision7?50*
	AttrInputPropDisable=INPUT_PROP_BUTTONPAD

However, because of the change introduced in 37ef4c19b4 ("Input: clear
BTN_RIGHT/MIDDLE on buttonpads") the BTN_RIGHT key bit is not mapped
anymore breaking the device right click button.

In order to fix the issue, create a quirk for the device forcing its
button type to touchpad regardless of the value reported by the
firmware.

[1] https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/481
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1868789

Fixes: 37ef4c19b4 ("Input: clear BTN_RIGHT/MIDDLE on buttonpads")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/hid/hid-ids.h        |  3 +++
 drivers/hid/hid-multitouch.c | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 78bd3ddda442..6cf7a5b6835b 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -287,6 +287,9 @@
 
 #define USB_VENDOR_ID_CIDC		0x1677
 
+#define USB_VENDOR_ID_CIRQUE_CORP		0x0488
+#define USB_DEVICE_ID_DELL_PRECISION_7X50	0x120A
+
 #define USB_VENDOR_ID_CJTOUCH		0x24b8
 #define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0020	0x0020
 #define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0040	0x0040
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 99eabfb4145b..f012cf8e0b8c 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -71,6 +71,7 @@ MODULE_LICENSE("GPL");
 #define MT_QUIRK_SEPARATE_APP_REPORT	BIT(19)
 #define MT_QUIRK_FORCE_MULTI_INPUT	BIT(20)
 #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
+#define MT_QUIRK_BUTTONTYPE_TOUCHPAD	BIT(22)
 
 #define MT_INPUTMODE_TOUCHSCREEN	0x02
 #define MT_INPUTMODE_TOUCHPAD		0x03
@@ -194,6 +195,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
 #define MT_CLS_WIN_8_FORCE_MULTI_INPUT		0x0015
 #define MT_CLS_WIN_8_DISABLE_WAKEUP		0x0016
 #define MT_CLS_WIN_8_NO_STICKY_FINGERS		0x0017
+#define MT_CLS_BUTTONTYPE_TOUCHPAD		0x0018
 
 /* vendor specific classes */
 #define MT_CLS_3M				0x0101
@@ -302,6 +304,15 @@ static const struct mt_class mt_classes[] = {
 			MT_QUIRK_CONTACT_CNT_ACCURATE |
 			MT_QUIRK_WIN8_PTP_BUTTONS,
 		.export_all_inputs = true },
+	{ .name = MT_CLS_BUTTONTYPE_TOUCHPAD,
+		.quirks = MT_QUIRK_ALWAYS_VALID |
+			MT_QUIRK_IGNORE_DUPLICATES |
+			MT_QUIRK_HOVERING |
+			MT_QUIRK_CONTACT_CNT_ACCURATE |
+			MT_QUIRK_STICKY_FINGERS |
+			MT_QUIRK_WIN8_PTP_BUTTONS |
+			MT_QUIRK_BUTTONTYPE_TOUCHPAD,
+		.export_all_inputs = true },
 
 	/*
 	 * vendor specific classes
@@ -1286,6 +1297,9 @@ static int mt_touch_input_configured(struct hid_device *hdev,
 	    (app->buttons_count == 1))
 		td->is_buttonpad = true;
 
+	if (app->quirks & MT_QUIRK_BUTTONTYPE_TOUCHPAD)
+		td->is_buttonpad = false;
+
 	if (td->is_buttonpad)
 		__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
 
@@ -1872,6 +1886,12 @@ static const struct hid_device_id mt_devices[] = {
 		MT_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT,
 			USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
 
+	/* Cirque Corp (Dell Precision 7550 and 7750 touchpad) */
+	{ .driver_data = MT_CLS_BUTTONTYPE_TOUCHPAD,
+		HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+			USB_VENDOR_ID_CIRQUE_CORP,
+			USB_DEVICE_ID_DELL_PRECISION_7X50) },
+
 	/* CJTouch panels */
 	{ .driver_data = MT_CLS_NSMU,
 		MT_USB_DEVICE(USB_VENDOR_ID_CJTOUCH,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-03-21 18:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-18 11:42 [REGRESSION] Right touchpad button disabled on Dell 7750 Takashi Iwai
2022-03-18 13:07 ` José Expósito
2022-03-18 13:11   ` Takashi Iwai
2022-03-18 14:06     ` Benjamin Tissoires
2022-03-18 14:28       ` José Expósito
2022-03-18 14:37       ` Takashi Iwai
2022-03-18 16:05         ` José Expósito
2022-03-18 22:01         ` [PATCH] HID: multitouch: fix Dell Precision 7550 and 7750 button type kernel test robot
2022-03-19  8:10       ` [REGRESSION] Right touchpad button disabled on Dell 7750 Takashi Iwai
2022-03-20 19:12         ` José Expósito
  -- strict thread matches above, loose matches on Subject: below --
2022-03-20 19:06 [PATCH] HID: multitouch: fix Dell Precision 7550 and 7750 button type José Expósito
2022-03-21  6:29 ` Thorsten Leemhuis
2022-03-21  9:25 ` Benjamin Tissoires
2022-03-21 18:22   ` Benjamin Tissoires
2022-03-21 18:48     ` José Expósito

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).