From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224JDzmazLOkbPYGL3TB5LXJ1jPxhIsGUiftg4VhU4Fm8Ij1LMEs3tu5FdcZJ3I+D8py63WO ARC-Seal: i=1; a=rsa-sha256; t=1517256495; cv=none; d=google.com; s=arc-20160816; b=UxNj3s1xgp9gGnOm9iTuYHOpZkIr/E3gu6VMaq5th1AKi5PPEEyLTH0eZFEFgL8qa3 6ARkhSqaAC8QGWzgMEHb3grdOOH0fls4o9DpcmxHSDGQQWE3/j1wnraxeqF9NXvlAl3j GzPh5PaWb8+1Gr8cMIkWgyRSLj+XTZYbU9hIQAZU8s5yzwx5b2durR1OcmcaGO61f/Pr 81wTq+Loe+NGpSCX8s5imlFFhpcNr22TrKT6Cu/HQn8he63htn5lveJrRroIAYlqQ9yf aW+UotER84lsyeanZ+wUBqsLJ7c8/EF54WIGNwqTE/mdlwle7SxDYYi5AR6v4dl7m9ZX wTWw== 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=uZDkMTNcbKcfWfg5sVPb5DwHHe1PxLj+NAEFm0VsB3c=; b=hdndRnhTl/2/gyUuTI1QzEv0EOQ13cf/dhTgT5g1cH++Bn20rVkDBX/4bePxaiDx97 rKe8376VNB5xRfx+h/hA43hckNE4CmwT5tKKmYVtsmMhbeTIBW3A/I7m9nioxL51pHvJ qIWfqdXFnw2LSRAAX8/PjvOSHSbrNukS8K9uoAS01K51rkG1xTodsg6GR0t+zZxRkOvf TCk++PUqyjkqtD5oH2NiH55wflNWHgjg/F5v7xzYHBwe28YyxCBbW7oz86WKdufVCILy ou0A8io/M0K0FLGWm2wVBs9ctRR8FncKIOmTnK+9VQ/1FJRa9WJfTM7bo0+6jljnbIgn nokQ== 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.14 09/71] Input: trackpoint - force 3 buttons if 0 button is reported Date: Mon, 29 Jan 2018 13:56:37 +0100 Message-Id: <20180129123827.965342780@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123827.271171825@linuxfoundation.org> References: <20180129123827.271171825@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?1590958747121476450?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-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(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);