Received: by 10.223.164.202 with SMTP id h10csp3749064wrb; Sat, 25 Nov 2017 16:21:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMaRFFP05+fy1AW23tWq6iF5PtR07AchgD0O464KnBic01beFJdtXxx6gwujKBdNs8ZIEGGP X-Received: by 10.99.168.5 with SMTP id o5mr32532055pgf.427.1511655698076; Sat, 25 Nov 2017 16:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511655698; cv=none; d=google.com; s=arc-20160816; b=DosG+oVee+hnxEZbak7kcNrm6dld7kGO61rv4Xiru190JJrO0M326P+ZolARRYZv8W 4++VtHsMe1TBGVQf9y95VJtkQxCyHQKGDDkkPkwdZgk9sYcb+167WxUadlTOT5dDZZqn JgADpIPP0bPL6gmvtdLmPKOZf/xC00t8t39E/lT7fMVwe1I1H9wrYl8uWphQEvqjwaY9 PEEyw8dZngvz7pLiwpj02ETc//MP5ubKcXxbQphT8SNDtHC6EPuoF4tDCgKPD6L6uqZ5 2B6ebWEOS9kh9y51ExsBtOr512vaWVAGg8muGg1ekZPXinpmjh0slPuZvxki7SD/QV7Y Gw6g== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=yxp+JYJMJrKDH7Pkctm82ac02YFcVof720m8vzzy7oo=; b=VJFRZe69LIW9pjHwQbtVuuwbpY6uXSjlqFlMC3C9sKNKLakdufgvNsAKxDWgkcCXmV dSWgeHAH5Jod92AQAxTP0hXbrxfoIAQYiEt9J9K4MDHVJvLr34v0tmFzLAm7gDjooM3K h6FMrhsmh3LOmDaRJwcBcmeH+iW/thrxmMw9bQLi+4vb9NrUo3SepTcWL65bhLM04NoB PjYCf0dhpPdAWnSckSLnCT0aQqUCAW9krOqpZj2dL/eDoLXW3CxXoFgwj4pEghUrTIde oZ9t7pSNXyIDHjlVNXqjT/4bOhZmWoU5v6c6PEscgmyoT6Pistx0ivmW0amsJmXr5w+n 5Yug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EIb+FaT5; 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 f11si21873818plm.77.2017.11.25.16.21.25; Sat, 25 Nov 2017 16:21:38 -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=EIb+FaT5; 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 S1751837AbdKZAUu (ORCPT + 81 others); Sat, 25 Nov 2017 19:20:50 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:41146 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751642AbdKZAUs (ORCPT ); Sat, 25 Nov 2017 19:20:48 -0500 Received: by mail-it0-f67.google.com with SMTP id x28so16978884ita.0; Sat, 25 Nov 2017 16:20:48 -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:in-reply-to:user-agent; bh=yxp+JYJMJrKDH7Pkctm82ac02YFcVof720m8vzzy7oo=; b=EIb+FaT5BREXQdsSQaC0L3gOqWQRy99TdoYCJQsAJFkX7rA7xXqrmwDC2+sSt6pMkE W+V2xWUHZwC6EXaXs9sawl+Wauo2pD+gKrpSOMV029L2lpTIBTqbzvhlRlky0s/WFD0z 8AqYpT4CCN6Egl4ZM2QFfD1Ll43OiuI2Y2ewpbYvGgm6YzfjqfmT0GzDkM+nKqmy/Sz3 qtBkF8PcrU4vOS6S3zEUFQShGEVUbt27ToWDBnzaynmuQp+bBRNTkh+P4XTqU9i/7xWd GUMWK034zU0DdgnzGvqDLF53MaDlbITSlNuyGYG6E6/NJxPnhCw44zqf555L/V5lr4nz l2Pg== 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:in-reply-to:user-agent; bh=yxp+JYJMJrKDH7Pkctm82ac02YFcVof720m8vzzy7oo=; b=XeCxVUPhsJ6VdwhOF+UsndGiRtig6pGH9cIj9D32Wx/aSk+oUXJLcvtJVBm6irf3PQ P1MMHQ1IK5ofsTyBXengAfJSu8P22yeUFig4wqlx+NNB6CAXwnY28A4r404XQirN5H8N 1qiWjeObEfAulXa7A7otIIzOv1gOPxuOutrj6leeUPLIQnm8YBm1Y1ILXfEAGIFd3iK/ 5BC39FOHXrqZ2OcuE2pv2mR6ti2jhe9IgZqSFbL1l8NK/TOcaClolHPVKsDUTWbWZZ1D XX7PlbJXHsWHbwkPyCexQ3SejZCgjRfdgRfUTrZH+8AqAHPXbUe9sL1mReETjnidh361 KL2A== X-Gm-Message-State: AJaThX7MtXw0HoLCC+F6UpxADFkffRdygGACm4q4Wu+5YgEpQw8nu3Sc Yel47A0x/u824foU+XtWKSA= X-Received: by 10.36.103.213 with SMTP id u204mr21953529itc.91.1511655647487; Sat, 25 Nov 2017 16:20:47 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1611:da80:8749:c06f:9515]) by smtp.gmail.com with ESMTPSA id i71sm10324963iod.74.2017.11.25.16.20.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Nov 2017 16:20:47 -0800 (PST) Date: Sat, 25 Nov 2017 16:20:44 -0800 From: Dmitry Torokhov To: Masaki Ota <012nexus@gmail.com> Cc: benjamin.tissoires@redhat.com, pali.rohar@gmail.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: <20171126002044.os6zuwg2jcyf5wm4@dtor-ws> References: <20171120075530.4880-1-masaki.ota@jp.alps.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171120075530.4880-1-masaki.ota@jp.alps.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 04:55:30PM +0900, 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); Should we execute this sequence only if is_dual is false above? > + > + 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; > } > -- > 2.14.1 > Thanks. -- Dmitry From 1585085621091025975@xxx Sun Nov 26 00:17:26 +0000 2017 X-GM-THRID: 1584570916340987763 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread