From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227QKwwvffbI9eyabxzAmOO4/INsxA4osT+bM/rNz0y/IrOyRFq0LcoOfBvQH6cf6cSpG6TH ARC-Seal: i=1; a=rsa-sha256; t=1517256456; cv=none; d=google.com; s=arc-20160816; b=rzVoeLwT72+NLa+jVZOZlIyssuw6FZgESNOsKrG3z1YjQ9VNrLrKxQu2mBIHO169Bu 8m2VNUqkXO48M16fOm42ZK5MzS1W6JyBsk9uEmNc2lxLRYybJTKhE6T6hgT/iYRkunkv 7X5IOvo1jVbEJt0fgu6VSHCe5EcngoG/Uodb/npn8sHcC98yI4T6do7T6K0rLKvVpD2k PcAf7groYeRYKTHRF04TpE9/pos9s4fEMqfrjBUx3IZDJVzBf3+5Vy0L+N5fMaxiBMmH XeVT4Nv2XT6Af4KoRKUa/cW3tMi7rxLSbFs6V0F7VcKv39GhLmKudz73nK1LZTs71AT9 7T+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=SjzMSCLexWmjme60wety/JDu3dRIbuTQ717vg10e8zk=; b=fX2mtA5oyAfUESp0uiGFMvTQ6cuPmm99QVY9j76qSa9Su67zatHG25mD5Zlj81wHA7 wmGxtSSH/ZT/qkXyZq00K39TWme6V9odeS1MN5tJqKV4sotwOT71FwFsVLsX5ykOXVj/ 4WS2F/GZ4ik5H8/M2osaFf3Drl1f2K3BhxJ5AzhbNG7btuutKa1Obeo2cFtK83xdgopH ouZrbwp9emkqVnY6Wr1pu/MuvY58rP/0H2vSuSJZPINBX0D6Guh3m/tzm2MXF9v3S5D8 +gvLmfW8THksVnKQbtAjaZyaGuVC9a70qe3YIpVkFUyMOSrgxKbv+S54UM/uvS4D6qyJ YYKw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590958706285854106?= X-GMAIL-MSGID: =?utf-8?q?1590958706285854106?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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);