Received: by 10.223.164.202 with SMTP id h10csp3915991wrb; Mon, 20 Nov 2017 07:05:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMbFkCNdXZya80rQGNGVyPKxPWGtyCqoYxNrk013peCpdGY+aB5WlFWryYDvXov11RGFXEuE X-Received: by 10.98.220.218 with SMTP id c87mr11690466pfl.229.1511190308014; Mon, 20 Nov 2017 07:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511190307; cv=none; d=google.com; s=arc-20160816; b=W47chfIi8lcz4RlMp1+xsZbLmCgCpvb+hZiZbgrSkfRfYKUSn3tnCYRpyk30Xu5Fvt 37izHn7cy8y5b3+moNyQDmSzEK/BUiETPvcECgha/seRB4AChCWPYaqTJHTKBGpfx1bH Q/G8VUZESnYYp+mC0XAEAQNzdoSppjlSN/un6JMHDPpK3DIKXwux/kZiAKXoozw//A/z Wh2DGnrPQd+DPiJbTeN24/3zzwL2/faWF4N8VDaTr5PfBGf/FRaaI12buAGPKX77kKKt TaQFM3FowVdyH8u47X7FcfsXo2wu14gBGMZIqehEinNQF9chJzFtIZ+IwzJzxali6V8w JJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=0gZjgoKj8l2w1e+3DbULxNaHyCmU+CwCIVDukO15zOg=; b=oLhm7VCdCo7AOc47VMsFdYT7il/sybaN87GNGI1Tt8mBEmpfKNX/Bz6xuGs18Ixao7 Wm/VBRipNDqNellPwU/8tq0AvFmtaDZ23JkRVwrdRY6kmIrGn9aMVWVigj+y5YZR964Q 7YSY7GHrpJGf6n0pC9lk1T4HKOrhf6iu+tF9c3m8nsJXrqW++oZ9u4ubs99bVIzK8Qcs 4vNsaWfpuSNfaFQknKYWIuh7vasX/f3Gu7LqKcpYD4s0kynYF5QhtpKKlcGwI/dgVagL QxFjV0ycn/7/9IWrLB74/yfoGE7fqH1wqMOHO82wE/NaRbWZej/RVHAw53j+n479eAzF Nc5A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si8294336pgr.194.2017.11.20.07.04.57; Mon, 20 Nov 2017 07:05:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301AbdKTPER (ORCPT + 66 others); Mon, 20 Nov 2017 10:04:17 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:38923 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbdKTPEQ (ORCPT ); Mon, 20 Nov 2017 10:04:16 -0500 Received: from [222.129.34.168] (helo=[192.168.1.18]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eGncM-0006CC-1g; Mon, 20 Nov 2017 15:04:14 +0000 Subject: Re: [PATCH] Support TrackStick of Thinkpad L570 To: Masaki Ota <012nexus@gmail.com>, dmitry.torokhov@gmail.com, benjamin.tissoires@redhat.com, pali.rohar@gmail.com, jaak@ristioja.ee, masaki.ota@jp.alps.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171120075530.4880-1-masaki.ota@jp.alps.com> From: Aaron Ma Message-ID: <4ff35112-5fc8-9557-d2bf-1b0cf7e12e1d@canonical.com> Date: Mon, 20 Nov 2017 23:03:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171120075530.4880-1-masaki.ota@jp.alps.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tested-by: Aaron Ma On 11/20/2017 03:55 PM, 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 | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c > index 850b00e3ad8e..cce52104ed5a 100644 > --- a/drivers/input/mouse/alps.c > +++ b/drivers/input/mouse/alps.c > @@ -2541,13 +2541,28 @@ 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; > > + /* For support TrackStick of Thinkpad L570 device */ > + 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 +2585,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; > } > From 1584573964710456046@xxx Mon Nov 20 08:44:52 +0000 2017 X-GM-THRID: 1584570916340987763 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread