Received: by 10.223.164.202 with SMTP id h10csp4089187wrb; Wed, 29 Nov 2017 00:20:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMZl1SlalQIfjjQhmdPGiqD6Z9gshJUlx/ZQ4NOlbEx9T7aV23ARYWTTBhAifGIyter5vW6U X-Received: by 10.98.23.68 with SMTP id 65mr2094134pfx.25.1511943630012; Wed, 29 Nov 2017 00:20:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511943629; cv=none; d=google.com; s=arc-20160816; b=utMXgn0BLUK/bXdqD7aDKNDHnHkmfDjJn//C992DdZcCeJ80yx4heS3nJ0gxQcCUWr ZPhD+v5t53QKVXaXH94s6P03DY//DrBveyQ2SrSLAg7Gxo7z3swVpxVxwqZBlfaqRa3i hm4Ynw7bBOEfd1wI4n30ojdNXzQLXfWQ3fPeUn8WieAC+4p1jL3v+xyBOg0EmQdj1R6F ALlnL5a7V23AWgOHw5tOyeOhi13/x9/qglolfpKtx1Ryx59UjrFH/9WBac4Zdxt25sLS fIWGHjhY3260WECR2gdhfnaKOloh+gFr2mR1tmDOsf0peRwhsV07CLfTdhx2H+jlim/J Tl/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Gk0rKOsSlqmG2ZJbVGGbdsw39SpKWBYboXnqxtV++JY=; b=f8VGNC2tUyK6R+rJGFl7gx63krPKGRZwvoUF+8Hf1pt1O5My1Mksf1ywZSpaIRZSLC zIkDLUs0GkOVHUgEmLH56mfGqwsXt5k+K3zongAI2Fl8rj00PPreLNb22EQ6q4IvHf+K PuM7hQoRGb6WND2sYeUTAkc1wMP/zjLRW9IHsGwpG2Oio9LqYoGZ+yeTGTrqv5+Lpq05 QzHMZKnv2cXXsptpN6udrWuiadvUa1l7VXC1I62EvYj7ek8oxKVuJxA03uoz0CuqlZmZ ad6XoKSE5whdxBLIqmk8OSwD31tnLB/CvGgKSBCwNFsbZAvuZt7PfwB4lS9xGPxMgtnV zGZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dZw1HFft; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o128si966507pfo.201.2017.11.29.00.20.19; Wed, 29 Nov 2017 00:20:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dZw1HFft; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbdK2IQk (ORCPT + 71 others); Wed, 29 Nov 2017 03:16:40 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:44275 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbdK2IQi (ORCPT ); Wed, 29 Nov 2017 03:16:38 -0500 Received: by mail-wm0-f65.google.com with SMTP id t8so4298815wmc.3; Wed, 29 Nov 2017 00:16:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Gk0rKOsSlqmG2ZJbVGGbdsw39SpKWBYboXnqxtV++JY=; b=dZw1HFftF0GXegygty76eLk4neiZK7ozPJgtBia6m23ZJ50fJ94LwrWydTBGnMxB/M 5jlHcbX7HLqnort105OFkBtOFu+o91A7bpdOQ1sM8An4LhqofgXRQQmXnD0mZa9TU/KU 9SuqCaca2TyqegjJERh3iNBxXjdL+fPErgRc+UFdiJf4SVGdJuTtntRa8qLFVMCxB6MD 71neczMLFalw0WABc2iIdNIVWDlNGzxPHnFpq0EY1E7lcSFqyUNFNlGF5L3IAN3auUXV Qwae/lgvr8PUun3ZX44J7N3AQQnrTPy6E4Gr9r/xOoZpqarRwWePMuwrkiNgNPaZ8VaS t3Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Gk0rKOsSlqmG2ZJbVGGbdsw39SpKWBYboXnqxtV++JY=; b=p60s/vjkBTxY1xS1fiubyW4GC4buvtJkHpme9PyKrrDMsAKTLjos3Mqo9VcGaVr+Zf CAYJRYBtrjh1DkdgVl6MLpyfgo8yyC5CChmppKmOilz7PM359DX8DYBu8JtpNjwVsh9D 6wrKmf/gYxRyNl7zZB5G2+HORAm7GvkO0QkgclWv7c5kH4K8caahsvkd5S1BUdtRUIe8 hI794Wnlcn0/chZ8fJqyl7HpePezdzShJQJ8VGOag9qZxV0yOcdn7YTJ4IeM8n9635zU MWFFgm1pTl4qyOUGdWnKzYKgpu9lSBlN2JD4qs/KtJd0LCzVRQN4wqaQZJ3IsYYff+KM Xd3w== X-Gm-Message-State: AJaThX4EBC9epyy0hwREwvaN9tHSjoxzYRMfu7LUwL6tCwM4O/aZ3+nc kyzzYWft5fYy+XBfcgGHy8U= X-Received: by 10.28.74.152 with SMTP id n24mr1629008wmi.7.1511943397172; Wed, 29 Nov 2017 00:16:37 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id q15sm888608wra.91.2017.11.29.00.16.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Nov 2017 00:16:36 -0800 (PST) Date: Wed, 29 Nov 2017 09:16:34 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Masaki Ota <012nexus@gmail.com> Cc: dmitry.torokhov@gmail.com, benjamin.tissoires@redhat.com, aaron.ma@canonical.com, jaak@ristioja.ee, masaki.ota@jp.alps.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Support TrackStick of Thinkpad L570 Message-ID: <20171129081634.agzw2f2pqbby4iln@pali> References: <20171129070105.5540-1-masaki.ota@jp.alps.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171129070105.5540-1-masaki.ota@jp.alps.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 29 November 2017 16:01:05 Masaki Ota wrote: > From: Masaki Ota > - The issue is that Thinkpad L570 TrackStick does not work. Because the main interface of Thinkpad L570 device is SMBus, so ALPS overlooked PS2 interface Firmware setting of TrackStick. The detail is that TrackStick otp bit is disabled. > - Add the code that checks 0xD7 address value. This value is device number information, so we can identify the device by checking this value. > - If we check 0xD7 value, we need to enable Command mode and after check the value we need to disable Command mode, then we have to enable the device(0xF4 command). > - Thinkpad L570 device number is 0x0C or 0x1D. If it is TRUE, enable ALPS_DUALPOINT flag. > > Signed-off-by: Masaki Ota > --- > drivers/input/mouse/alps.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c > index 850b00e3ad8e..dd2c9e9f4830 100644 > --- a/drivers/input/mouse/alps.c > +++ b/drivers/input/mouse/alps.c > @@ -2541,13 +2541,31 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], > } > > static int alps_update_dual_info_ss4_v2(unsigned char otp[][4], > - struct alps_data *priv) > + struct alps_data *priv, > + struct psmouse *psmouse) > { > bool is_dual = false; > + int reg_val = 0; > + struct ps2dev *ps2dev = &psmouse->ps2dev; > > - if (IS_SS4PLUS_DEV(priv->dev_id)) > + if (IS_SS4PLUS_DEV(priv->dev_id)) { > is_dual = (otp[0][0] >> 4) & 0x01; > > + if (!is_dual) { > + /* For support TrackStick of Thinkpad L570 device */ Hi! Jonathan Liu wrote that this patch is needed also for ThinkPad E570p laptop. So it would be better to add comment that Thinkpad L570 is not the only one affected and fixing is_dual is needed also for others. (Probably all Thinkpads which has same generation with this touchpad.) Such information could prevent in future to wrongly refactor this hook code. > + if (alps_exit_command_mode(psmouse) == 0 && > + alps_enter_command_mode(psmouse) == 0) { > + reg_val = alps_command_mode_read_reg(psmouse, > + 0xD7); > + } > + alps_exit_command_mode(psmouse); > + ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); > + > + if (reg_val == 0x0C || reg_val == 0x1D) > + is_dual = true; > + } > + } > + > if (is_dual) > priv->flags |= ALPS_DUALPOINT | > ALPS_DUALPOINT_WITH_PRESSURE; > @@ -2570,7 +2588,7 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse, > > alps_update_btn_info_ss4_v2(otp, priv); > > - alps_update_dual_info_ss4_v2(otp, priv); > + alps_update_dual_info_ss4_v2(otp, priv, psmouse); > > return 0; > } -- Pali Rohár pali.rohar@gmail.com From 1585382940679968842@xxx Wed Nov 29 07:03:12 +0000 2017 X-GM-THRID: 1585382940679968842 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread