Received: by 10.223.185.116 with SMTP id b49csp6356359wrg; Wed, 28 Feb 2018 08:06:01 -0800 (PST) X-Google-Smtp-Source: AH8x227/VcFlA4hrgkOXtY0S2tm0fpVBZows+Zsz9S0T2XZS+BjVj/TrmSjd3oGuE7BPU2rSJfg5 X-Received: by 2002:a17:902:8c91:: with SMTP id t17-v6mr18605816plo.233.1519833960982; Wed, 28 Feb 2018 08:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519833960; cv=none; d=google.com; s=arc-20160816; b=i/SWcYJVIW3x2dH68q66UtQuHvtHiWD++eSiEq/B4SZe5hiANHYXV/qtVaLfipFAfG 8tl/d92Z7oHGSlOF70W46oq08hh1mFwz8kVSAEccfDfoYntzNC0BIBhu2fygOqA6p55x xaP8Iee/5HOR18EY8/SBMZalf4KNx2yu8CGUwM5sVUhGL2Fyj/h9tw3nxYcAqH1UQjc9 g6vxRRYiJyeNeG9UEb5ToYqddoOUT3lauhWskXtvGELEucqjXKjdyoDobGkkGJWUVKh/ QiLoqKvdG4wXUpd5HxzLotiZ+heMkAl4bgh9mt0loy57LHGvlcRIDVTbsgFhQqhrbHim WZgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=fFSC4Zc4C4M1VPt3aGulJsiSXJFqy2Jywj3ZxF0YXxw=; b=qvN2EvboSjWOunCxOWjroznwW6KX4YmC+kiTSo+NFUxTmU6JGXgL3nkxvZOsTBsR1n 5WKfbHriZoO/v2ybjAayintSlKVNXWz+M+7MAm7rekGyVCJ92tVez+d6Z79L35/NpDho 54eTzACr7kJnKBBn0XC+rja/fhF62VO8dfLdjCBmgpGV4Jm7dfwjJYye8uwRN7OAqPcb HCyq+Q6qxiu3j9rs/k48Bct8hPZsLt31lJMt0fNiXucbQDpk9LC5n7ITdJpJ1fMp/LuS CJrPgiP7yVFu6z6CASU8vBg3Mew6X0AsPsFWZJz0EsYjv2AHt47zEz+FwDUxMo9tG5ii G5Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m68si1189123pgm.88.2018.02.28.08.05.46; Wed, 28 Feb 2018 08:06:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934386AbeB1QEe (ORCPT + 99 others); Wed, 28 Feb 2018 11:04:34 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34829 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbeB1QEb (ORCPT ); Wed, 28 Feb 2018 11:04:31 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yo-0006XU-A1; Wed, 28 Feb 2018 15:22:26 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yk-0000I7-Fs; Wed, 28 Feb 2018 15:22:22 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Dmitry Torokhov" , "Aaron Ma" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 226/254] Input: trackpoint - force 3 buttons if 0 button is reported In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Aaron Ma commit f5d07b9e98022d50720e38aa936fc11c67868ece upstream. Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands. They supposed to reply with 0x02, 0x03, or 0x04 in response to the "Read Extended ID" command, so we would know not to try certain extended commands. Unfortunately even some trackpoints reporting the original IBM version (0x01 firmware 0x0e) now respond with incorrect data to the "Get Extended Buttons" command: thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGE psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0 Since there are no trackpoints without buttons, let's assume the trackpoint has 3 buttons when we get 0 response to the extended buttons query. Signed-off-by: Aaron Ma Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196253 Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/mouse/trackpoint.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -379,6 +379,9 @@ int trackpoint_detect(struct psmouse *ps if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n"); button_info = 0x33; + } else if (!button_info) { + psmouse_warn(psmouse, "got 0 in extended button data, assuming 3 buttons\n"); + button_info = 0x33; } psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);