[1/1,SRU,Artful] Input: trackpoint - assume 3 buttons when buttons detection fails

Message ID 20170906042935.23586-2-aaron.ma@canonical.com
State New
Headers show
Series
  • Fix middle button issue of trackpoint
Related show

Commit Message

Aaron Ma Sept. 6, 2017, 4:29 a.m.
From: Oscar Campos <oscar.campos@member.fsf.org>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1715271

Trackpoint buttons detection fails on ThinkPad 570 and 470 series,
this makes the middle button of the trackpoint to not being recogized.
As I don't believe there is any trackpoint with less than 3 buttons this
patch just assumes three buttons when the extended button information
read fails.

Signed-off-by: Oscar Campos <oscar.campos@member.fsf.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry-picked from commit 293b915fd9bebf33cdc906516fb28d54649a25ac)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/input/mouse/trackpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Seth Forshee Sept. 8, 2017, 1:05 p.m. | #1
On Wed, Sep 06, 2017 at 12:29:34PM +0800, Aaron Ma wrote:
> From: Oscar Campos <oscar.campos@member.fsf.org>
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1715271
> 
> Trackpoint buttons detection fails on ThinkPad 570 and 470 series,
> this makes the middle button of the trackpoint to not being recogized.
> As I don't believe there is any trackpoint with less than 3 buttons this
> patch just assumes three buttons when the extended button information
> read fails.
> 
> Signed-off-by: Oscar Campos <oscar.campos@member.fsf.org>
> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> (cherry-picked from commit 293b915fd9bebf33cdc906516fb28d54649a25ac)
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>

Applied to artful/master-next. Note for the future that buglinks should
be formatted like this:

 http://bugs.launchpad.net/bugs/XXXXXXX

I fixed up the link above when I applied the patch. Thanks!
Aaron Ma Sept. 8, 2017, 1:36 p.m. | #2
Hi, Seth:

I just sent this patch to stable kernel. And got reply from maintainer.
Should we skip apply this patch for ubuntu kernel?

Because there is a user report a issue on stable kernel.

The reply email quoted:

This is a note to let you know that I've just added the patch titled

    Input: trackpoint - assume 3 buttons when buttons detection fails

to the 4.4-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     input-trackpoint-assume-3-buttons-when-buttons-detection-fails.patch
and it can be found in the queue-4.4 subdirectory.

Sorry for inconvenience,
Aaron

On 09/08/2017 09:05 PM, Seth Forshee wrote:
> On Wed, Sep 06, 2017 at 12:29:34PM +0800, Aaron Ma wrote:
>> From: Oscar Campos <oscar.campos@member.fsf.org>
>>
>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1715271
>>
>> Trackpoint buttons detection fails on ThinkPad 570 and 470 series,
>> this makes the middle button of the trackpoint to not being recogized.
>> As I don't believe there is any trackpoint with less than 3 buttons this
>> patch just assumes three buttons when the extended button information
>> read fails.
>>
>> Signed-off-by: Oscar Campos <oscar.campos@member.fsf.org>
>> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> (cherry-picked from commit 293b915fd9bebf33cdc906516fb28d54649a25ac)
>> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> 
> Applied to artful/master-next. Note for the future that buglinks should
> be formatted like this:
> 
>  http://bugs.launchpad.net/bugs/XXXXXXX
> 
> I fixed up the link above when I applied the patch. Thanks!
>
Seth Forshee Sept. 8, 2017, 3:25 p.m. | #3
On Fri, Sep 08, 2017 at 09:36:42PM +0800, Aaron Ma wrote:
> Hi, Seth:
> 
> I just sent this patch to stable kernel. And got reply from maintainer.
> Should we skip apply this patch for ubuntu kernel?
> 
> Because there is a user report a issue on stable kernel.
> 
> The reply email quoted:
> 
> This is a note to let you know that I've just added the patch titled
> 
>     Input: trackpoint - assume 3 buttons when buttons detection fails
> 
> to the 4.4-stable tree which can be found at:
> 
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      input-trackpoint-assume-3-buttons-when-buttons-detection-fails.patch
> and it can be found in the queue-4.4 subdirectory.

It's fine to apply it ahead of getting it through upstream stable. And
for zesty there is no longer any upstream stable, so we need the
backport you sent there either way.

Seth

Patch

diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 922ea02edcc3..20b5b21c1bba 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(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\n");
+		button_info = 0x33;
 	}
 
 	psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);