Received: by 10.223.176.5 with SMTP id f5csp3430937wra; Mon, 29 Jan 2018 13:04:54 -0800 (PST) X-Google-Smtp-Source: AH8x224131+pd4CSNsIlLOmxPERb2EwEZrwaXkrP0qbyYqyH6ZYX64n0AeBXeWiO0lkw7ztgdeAO X-Received: by 10.98.138.21 with SMTP id y21mr28156564pfd.147.1517259894591; Mon, 29 Jan 2018 13:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517259894; cv=none; d=google.com; s=arc-20160816; b=vxuTciAoZw+prh0v8RxP4btaiX3IfffNINYiYS88nm+y5mez5JAAisowc8iMdzRzOa wsrpilVjI2A5EFdbbeR9z4IudYAJemfuQwSJa8NRx55eON28O52OhCjPW33FtmnNS0Vb kvuk3kzQ2Zay5FaDKaUD+TAXXI5unqT1w+DMIl9iHP471Aj4PgNm4bkHawzfwp4Gexl7 olnE4ZxOsvr6mTPvYIv90bJ5nFz3LIxfwDNvvAovNdzJarVzUN5FTFvTqi8TlLjqUZ+M tMU5jePhgH/nyrkh2TFnElTy0msrGn3prR5hQmf9DsNgeVIduJevjNWYXLoom/8nsQ4j vERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SjzMSCLexWmjme60wety/JDu3dRIbuTQ717vg10e8zk=; b=nH59eCnA+eSkLfo3+CVMnFL0Nf9uVI6ggEb8PjcGrJBFB85jqlApN3CuuQv1rBvbdu RcdTgoeJt+QE/eaX+xUZraveUdoONDWfHZY+jCkV4NLMskudZWh+C/PoKBFxd/GH/qeT mryPEG1CxuTxD8gjTaJfDxksJpOCn42GYr4UaGWkCVuLNH5TcjIxQRIptWNz6bzNJYvB HNa5WewiTTyBRV163ACMsozBJyO0jcutpQQ+X3NxBpqT/2PNge8XDiwEwjKhy5A2rNbv +HuNBv/c456YCmenxnxl0O4jwSGCNN5NwvnIcSuXx/nOqDKBWugyfr9aRs1hytlUn3HK 4HLA== 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 a7-v6si10053252plz.613.2018.01.29.13.04.40; Mon, 29 Jan 2018 13:04:54 -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 S1752915AbeA2UHi (ORCPT + 99 others); Mon, 29 Jan 2018 15:07:38 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51072 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752587AbeA2UHf (ORCPT ); Mon, 29 Jan 2018 15:07:35 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0E4A72F20; Mon, 29 Jan 2018 13:02:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Dmitry Torokhov Subject: [PATCH 4.4 48/74] Input: trackpoint - force 3 buttons if 0 button is reported Date: Mon, 29 Jan 2018 13:56:53 +0100 Message-Id: <20180129123849.755094564@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123847.507563674@linuxfoundation.org> References: <20180129123847.507563674@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable 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: Greg Kroah-Hartman --- drivers/input/mouse/trackpoint.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -383,6 +383,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);