From patchwork Mon May 29 11:45:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Campos X-Patchwork-Id: 9753099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E10AD602B1 for ; Mon, 29 May 2017 11:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C25E32846F for ; Mon, 29 May 2017 11:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B565828474; Mon, 29 May 2017 11:42:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA8D2846F for ; Mon, 29 May 2017 11:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751015AbdE2Lmr (ORCPT ); Mon, 29 May 2017 07:42:47 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33989 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbdE2Lmq (ORCPT ); Mon, 29 May 2017 07:42:46 -0400 Received: by mail-lf0-f67.google.com with SMTP id q24so5993392lfb.1 for ; Mon, 29 May 2017 04:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=lJCAKe0swSTN5CqyHVcU6mAYKXy3kXlxgy94Tz0Mz5Q=; b=WYtgR1q0PehjGvXTkVailwqcyp5puim+762kfWhW5iNqoGIJe2xfKpDEFCfbW4l3/H 97INe1/bydrkF/bz0fPyv7g+BWV5LWE5lE660kL0ctOGLnPtJfEaDs4oyWD3GqWqhwkk WsnnBJCPVr6Cscoh2tPJheVzOVRW7LR1zje2Ur0/elxKQBIqDQ+MchGO5imyunpw1lWN 9c56cshtCv/zGP1lHMxhxDdASI1PaB+0SABH/7686UN/xm4AbIUc9urcEx8dAF+cpK2U 1JmeiVdBBcq6S9HTaII49KdBAIt2bZwygOtnQ4wuy7QuW6Qiavl8sTC9BOM4mWW8Czud wxeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mime-version:content-disposition:user-agent; bh=lJCAKe0swSTN5CqyHVcU6mAYKXy3kXlxgy94Tz0Mz5Q=; b=qYrC8idaScqSyisj0jx2K6mIZr5EJKmfkvDEki9Og5CiZCR6yQNeY7oKT1hyDJhBap r12WPgXT5TENWVU0xi5dJqjhINfMzqLHx5lyfBNsDzp2LUH3WixyMJMHs/PfK1X8iU20 BcqIa5LDLdYAfF9zbK+MTdPpbRPo+TkSshb6CLb7rdDk9hT88jjXqTd62n38u58gzs9Q BdKkxlRP0OOdaeESWPx3qcdXtRALPZUHhzUNIs9U9vfnzxT/jt7Uh57c71uzdczaGmUE 1vnLinIAB70hdB7Nfb9OY4J9IXutDGXyS/FN3AYOArcTYc0kFce4C70xbe/lmm6hUfeg lqsA== X-Gm-Message-State: AODbwcAEu0XKAl3GJblun9poKSjqOITtiv2zhfmWIeqxB+UZwo2F9aMb 420kCKgRAa8wyw== X-Received: by 10.80.153.118 with SMTP id l51mr12297346edb.7.1496058165232; Mon, 29 May 2017 04:42:45 -0700 (PDT) Received: from ThinkStation (87-198-249-154.static.ptr.magnet.ie. [87.198.249.154]) by smtp.gmail.com with ESMTPSA id h33sm3659478edh.50.2017.05.29.04.42.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 May 2017 04:42:44 -0700 (PDT) Date: Mon, 29 May 2017 12:45:01 +0100 From: Oscar Campos To: Dmitry Torokhov Cc: linux-input@vger.kernel.org Subject: [PATCH] input: mouse: trackpoint: assume 3 buttons when buttons detection fails Message-ID: <20170529114458.GA28855@ThinkStation> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Cc: linux-input@vger.kernel.org Signed-off-by: Oscar Campos --- drivers/input/mouse/trackpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);