Re: Input: mouse: Trackpoint middle button not recognized on Thinkpad E470

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26/04/17 00:10, Dmitry Torokhov wrote:
Hmm.. I do not recall seeing real trackpoints with only 2 buttons. Let's
try defaulting to 3 and see what happens.

This patch assumes three buttons when the trackpoint_read command failed. This is just a quick fix. trackpoint_read may fail for other reasons than the extended-button-data command not being available, e.g. errors in the ps2 communication. A more narrow solution should check if a resend request was received, resend, and if the resend failed assume three buttons.
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 354d47e..70c3a48 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -380,8 +380,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
 		return 0;
 
 	if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
-		psmouse_warn(psmouse, "failed to get extended button data\n");
-		button_info = 0;
+		psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons are present\n");
+		button_info = 0x33;
 	}
 
 	psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux