From patchwork Wed Apr 26 21:18:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Exner X-Patchwork-Id: 9702037 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 EC4E860245 for ; Wed, 26 Apr 2017 21:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFCF728404 for ; Wed, 26 Apr 2017 21:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2F7928470; Wed, 26 Apr 2017 21:18: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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI 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 0965228404 for ; Wed, 26 Apr 2017 21:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030393AbdDZVSr (ORCPT ); Wed, 26 Apr 2017 17:18:47 -0400 Received: from smarthost.TechFak.Uni-Bielefeld.DE ([129.70.137.17]:47528 "EHLO smarthost.TechFak.Uni-Bielefeld.DE" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030396AbdDZVSq (ORCPT ); Wed, 26 Apr 2017 17:18:46 -0400 Received: from [192.168.1.108] (ip-84-118-111-176.unity-media.net [84.118.111.176]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jexner) by smarthost.TechFak.Uni-Bielefeld.DE (Postfix) with ESMTPSA id F3B5A80028; Wed, 26 Apr 2017 23:18:44 +0200 (CEST) Subject: Re: Input: mouse: Trackpoint middle button not recognized on Thinkpad E470 To: Dmitry Torokhov , ulrik.debie-os@e2big.org References: <13710506-2225-9f81-40e3-7463ac829860@techfak.uni-bielefeld.de> <20170425211633.bl72ajw5duwdpq4j@beacon.debie> <20170425221014.GD30843@dtor-ws> Cc: "linux-input@vger.kernel.org" , aduggan@synaptics.com From: Julian Exner Message-ID: Date: Wed, 26 Apr 2017 23:18:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170425221014.GD30843@dtor-ws> 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 On 26/04/17 00:10, Dmitry Torokhov wrote: > Hmm.. I do not recall seeing real trackpoints with only 2 buttons. Let's > try defaulting to 3 and see what happens. This patch assumes three buttons when the trackpoint_read command failed. This is just a quick fix. trackpoint_read may fail for other reasons than the extended-button-data command not being available, e.g. errors in the ps2 communication. A more narrow solution should check if a resend request was received, resend, and if the resend failed assume three buttons. diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 354d47e..70c3a48 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(&psmouse->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 are present\n"); + button_info = 0x33; } psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);