Received: by 10.223.164.202 with SMTP id h10csp4117122wrb; Wed, 29 Nov 2017 00:59:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMb9aVe0E7vd0Q5X6a/EUlzh7fahyVHlAVTf0XbI/rOnWokGb0G3dqgxd2IJxQpC1d4FTG0u X-Received: by 10.84.143.70 with SMTP id 64mr2150472ply.277.1511945962086; Wed, 29 Nov 2017 00:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511945962; cv=none; d=google.com; s=arc-20160816; b=fdL4KxKP5B0MgJd0VNSqIJtNOH0FSr1SOuw0mFy5XpWOKK/eIwzCMW8MTqknxhKNNK aCji6/41+J6vnFJfqSZEVXIMZBVKnYTUYX4vD7DDtCh9BxTlNFCpswJ9GnPm09Yb4n6l w5gWxyZTalF+8WfAky/K0Jn5aD5uNIcgh9dHlgBr4Vi53BQ/gK42i8CVYBkEUurOHofn 6RsU2vBupwpZbUGrMtEtS1t63X0MP99y2T4tCTHcUi1ogYaCMhDHMvrALqGUCqGUvmnC 42eI4F5D/J0JPinH5/2xqK9h7dJQHVrRYE77fXDG/ugVkfn4feUVYwmIWwF3Q26+F2WX bKVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=G6fXbNpHmVO9g2ph+dnzlXzS//tTDKydLUSIUcAr4f0=; b=ZFHciZdRV8KwO3ZW5+WBmY18eoagbQRHF2ertrG72Sh8cDrMgr6rSVtRp7qOtqk4w9 Hg0BSf7iuU8/NsbFZFqo7P1V2MN9UsvHljsIq5BlgNv9CqWKh1nl9QPYNVwbmyPZW0jS n8IAAytcCI2zwBagpDYOGUV32eO/555va+PmtqopNoJmm6Xq9wa67qwywWzeUZ+hznhu yr7i4S2EYz68Yiihve1Vjb3+8WQFeF5ggVW3MDdXhPemKMNTMOEwjpFXPqM23hLNvWnU ta5LV544uOH8vz5wW/+j3Q0EFPDG67UlSTezRdonQlqfqHptMGbO0IxCTO5dsXQDhHHU 8yVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qz41XJt/; 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 u17si949336pge.390.2017.11.29.00.59.11; Wed, 29 Nov 2017 00:59:22 -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=Qz41XJt/; 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 S1753300AbdK2IeI (ORCPT + 71 others); Wed, 29 Nov 2017 03:34:08 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:39129 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753166AbdK2IeG (ORCPT ); Wed, 29 Nov 2017 03:34:06 -0500 Received: by mail-pf0-f194.google.com with SMTP id l24so1238572pfj.6; Wed, 29 Nov 2017 00:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=G6fXbNpHmVO9g2ph+dnzlXzS//tTDKydLUSIUcAr4f0=; b=Qz41XJt//0IA7bLOvA242F5IDUId+F+m/+YR28HCwZdP3k62Z0YH8A+OJO/Tk6VzxX An2WREVCEiYCI8DED1PzPgzwAWmXDntNP7y6QeTUjqHrmeYYsLHusyQGkquJXZjTsiWe udzHh+Y0B6sKXrvR6/LXI98Tr6ixW6j4zFqXfEfygP7TfxYxle9qKawW0S0KNW8TDaGR bPxFQrFbIGrpoNimezN8CefJQRed6PIQqLd7o9aXmvxuCFPO66/nFIlb5mHXTc632Xxd gKCkmNEqA0z+3yw/YHlc4vesWuur9dMbZ5M7fdThWozO4/fp2unElUCl/tNhRsny9C7b Coqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G6fXbNpHmVO9g2ph+dnzlXzS//tTDKydLUSIUcAr4f0=; b=d/2RDT/nh0QU0S34QhFVFwu4drabh1iFDN5o0vNz1QMVNrk8Vxeh/MCXvjiJ8Pi/Wq e9Ud45ev8zBqmB489b6OqVf8aSjp/s0rwAVKJ9XkqtFYpfB+3FUNNvs0gr09AMD0+Iuv MR4i71DrL4Hvu0dwyvZvuESqo67at4faeFpXIAJ6MwKQrWgZLXPmg7Qs25owPq3G3mEd /atJKxpGy2mfuBGqhCOqkuXBrTQxJ9QEz31myeLeC13QMPwrOvnhpJvGACeovCbMbtCt 6IezVnRZupA3exkLNH/SBIGkNNJsS7R2dolWJEIjaxR+meEXHsrH51ABOJZHHBPeIsbD 2/xQ== X-Gm-Message-State: AJaThX5BjmLx7lg3tuixYuUSK6TTCAzKMu4DVC6qt6b1Yi1yF/JdLT4E vIhYYzJWC68l70plC3+d8Dg= X-Received: by 10.99.133.200 with SMTP id u191mr2033775pgd.327.1511944445547; Wed, 29 Nov 2017 00:34:05 -0800 (PST) Received: from localhost (p2218-ipad303aobadori.miyagi.ocn.ne.jp. [123.216.73.218]) by smtp.gmail.com with ESMTPSA id m87sm2359344pfi.88.2017.11.29.00.34.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Nov 2017 00:34:04 -0800 (PST) From: Masaki Ota <012nexus@gmail.com> X-Google-Original-From: Masaki Ota To: dmitry.torokhov@gmail.com, benjamin.tissoires@redhat.com, pali.rohar@gmail.com, aaron.ma@canonical.com, jaak@ristioja.ee, masaki.ota@jp.alps.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Support TrackStick of Thinkpad L570 Date: Wed, 29 Nov 2017 17:33:58 +0900 Message-Id: <20171129083358.5063-1-masaki.ota@jp.alps.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..6f092bdd9fc5 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 L/E series */ + 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; } -- 2.14.1 From 1585883947395068327@xxx Mon Dec 04 19:46:29 +0000 2017 X-GM-THRID: 1584603104387358911 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread