Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1003110pxk; Thu, 3 Sep 2020 19:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJfS5Vsgn29pc1U+8pOTXCTvFUufPsXRRkseogN7Etp7r7MWiT27c3yKURMT79FbkO7NCU X-Received: by 2002:aa7:ca4f:: with SMTP id j15mr6425080edt.378.1599187995695; Thu, 03 Sep 2020 19:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599187995; cv=none; d=google.com; s=arc-20160816; b=LsSmtUCIzINzdx2M/LQZJT+PjNbCYvbPfFFh7CpSKCgQC2pgbgXoVEE/eA4Plj3M7r pYvpRwQG5j1Ba/W7o9EBrDB9kGYfPfdrNjulezI0E/g65yrjXhr0mUzm4sBqGRShFYp9 cCqJPOSL0iAtGtWF5as3CplrmskzhEW5mzrl7kxaw1hVYCk6bqtUg4q0zBu+HyB7P7IQ umdq75tFVurVUrQx7PlepeY2lBvEmNNqz00qyv4yyQj2KIjF7bPSgWnTUXRXTlw5pP+a GjCSEAmyVXLMhKAdH62LUpiQyXtfO2RfoNyFl6NMykdAgviA8KmVTPFKFI7h5sMZ0Zkl O6cA== 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; bh=eGcmgdY550ZVPvEL2Q4QYRRH+BaJk9xqt56x0OVrId0=; b=Y2D3cUfwz8k4SzQMs29QzoCVO3vSQkFURbcbQgX8azzXWTaDAOjDSFGTualIfPiaEO gTg0RJ6N/Pz9Jl+tdhp5za9/EklbAaxFrllYxyJaY4XGxqg3aur6PCFnNvm2uTe+F+WM y0Len9mAuxur3hi9OIhlLr1Z+M9jarhMJvV6DF4tEwDazOlXKu41jTO0mh3QE4wm8SL9 I17jPDN+56CD+HvKbm9zNzUmBcLAucjQPcEJ0jVDYHMRAdRTGMBX1drnAi3wZassfzUQ kGKmgxYumWpfdBSyvyedyxERlGfpXxmwegQsksnDaQNpzJYGPNaaT2bTtLBC4qoO4Ow8 xZ8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si3187466edl.567.2020.09.03.19.52.53; Thu, 03 Sep 2020 19:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729600AbgIDCwT (ORCPT + 99 others); Thu, 3 Sep 2020 22:52:19 -0400 Received: from emcscan.emc.com.tw ([192.72.220.5]:30058 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729521AbgIDCwS (ORCPT ); Thu, 3 Sep 2020 22:52:18 -0400 X-Greylist: delayed 583 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Sep 2020 22:52:17 EDT X-IronPort-AV: E=Sophos;i="5.56,253,1539619200"; d="scan'208";a="37169782" Received: from unknown (HELO webmail.emc.com.tw) ([192.168.10.1]) by emcscan.emc.com.tw with ESMTP; 04 Sep 2020 10:42:30 +0800 Received: from 192.168.10.23 by webmail.emc.com.tw with MailAudit ESMTP Server V5.0(142871:0:AUTH_RELAY) (envelope-from ); Fri, 04 Sep 2020 10:42:30 +0800 (CST) Received: from 101.12.41.239 by webmail.emc.com.tw with Mail2000 ESMTPA Server V7.00(2486:2:AUTH_LOGIN) (envelope-from ); Fri, 04 Sep 2020 10:42:27 +0800 (CST) From: "jingle.wu" To: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: phoenix@emc.com.tw, "jingle.wu" Subject: [PATCH] Input: trackpoint - Add Suspend mode for Elan TrackPoint Date: Fri, 4 Sep 2020 10:42:31 +0800 Message-Id: <20200904024231.26812-1-jingle.wu@emc.com.tw> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "jingle.wu" Add suspend command for elan trackpoint --- drivers/input/mouse/trackpoint.c | 16 ++++++++++++++++ drivers/input/mouse/trackpoint.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 3eefee2ee2a1..b3cba973a4eb 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -389,6 +389,20 @@ static int trackpoint_reconnect(struct psmouse *psmouse) return 0; } +static void trackpoint_cleanup(struct psmouse *psmouse) +{ + struct trackpoint_data *tp = psmouse->private; + u8 param[3] = { TP_TOGGLE, TP_TOGGLE_BURST, TP_TOGGLE_ELAN_SLEEP }; + + if (tp->variant_id == TP_VARIANT_ELAN) { + if (ps2_command(&psmouse->ps2dev, param, + MAKE_PS2_CMD(3, 0, TP_COMMAND))) { + psmouse_err(psmouse, + "failed to suspend trackpont.\n"); + } + } +} + int trackpoint_detect(struct psmouse *psmouse, bool set_properties) { struct ps2dev *ps2dev = &psmouse->ps2dev; @@ -421,6 +435,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) psmouse->reconnect = trackpoint_reconnect; psmouse->disconnect = trackpoint_disconnect; + psmouse->cleanup = trackpoint_cleanup; + if (variant_id != TP_VARIANT_IBM) { /* Newer variants do not support extended button query. */ button_info = 0x33; diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h index 5cb93ed26085..c7fa75452976 100644 --- a/drivers/input/mouse/trackpoint.h +++ b/drivers/input/mouse/trackpoint.h @@ -107,6 +107,7 @@ #define TP_TOGGLE_EXT_TAG 0x22 /* Bit 3 of the first packet coming from the external device will be forced to 1 */ #define TP_MASK_EXT_TAG 0x04 +#define TP_TOGGLE_ELAN_SLEEP 0x8 /* Power on Self Test Results */ -- 2.17.1