Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1166550pxb; Thu, 24 Mar 2022 14:11:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC0qGb/ZyI7u9hiJD6vf6Q4Y1D0AP/jPHfoTw6WFoxZFoC2oXO51z2UUkU08HD0HIwvJHs X-Received: by 2002:a50:d78e:0:b0:416:2cd7:7ac5 with SMTP id w14-20020a50d78e000000b004162cd77ac5mr9113200edi.320.1648156280812; Thu, 24 Mar 2022 14:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648156280; cv=none; d=google.com; s=arc-20160816; b=b+q23QwN9KyIAaQ5t1qzKyugLrbOoN072Mw5DLL0TzbCUeMobdz/r65zGjjKwbW05o qPMCKXhEhpXqg22vW/QwtkL4fFOk0NTtw5e77Zucjk5IGMQZ2Jqio+99rjlZbJjpP1Yb /ZPbury+YwYa5lhx8JIiYAKbyH2l2bvnSi7wl4wrQFTgcOshKXGiHfc+1KQT9qHj05ql WJ9J/mv590zxdLrg1rlIy5i6wO8AXDtR5TbN9aWx1l384Wo9obiMJ9PiiBkOtX6JZ6B5 NB1Bwoun+YN2B+zOk+IWGSH6dBNVc31zI4xq8J2BUQAERWICU4jSOgfcr5inL8Pl6Pa+ fNIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W5pYT/F8t16XQbM3qlDKbbsJw4C6bC82sHdzEgCXN8E=; b=arXzc4UFvXKLAicbx0SV4iJUrno/QlzBoaIU1sm8zhpwP9F46mvEirIWw9qAQUKchn YRvhW30W8xrkyWK1LN0ToTLg+E/G7euFMhVbFyZN3eh1O7/X3ty7XxKlqviYUQXavytd Uy+AEDfjNAPGOZnXGjVrz3Aoh+5+Ol7Y5ik+atBM+S5jOrsAMp8obVKtU1PgkUjbeZmO j/ofPLU3+xX5gW7mRhK4LW+e2EE4J9YBSHFHVJ4vUmWBbkMUZt2SRBQ8D6CzbBxt6tom IaAeHRL5NdwFHkv1+mHrN3a4ip7t13XrAQS3Ku1eE69EDBUut9YvOdoGEXorn2UAZHGa ff2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GDg1zhAM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a05640226cc00b00418c2b5bd7esi1065207edd.96.2022.03.24.14.10.55; Thu, 24 Mar 2022 14:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GDg1zhAM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343567AbiCWR3G (ORCPT + 99 others); Wed, 23 Mar 2022 13:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239166AbiCWR3E (ORCPT ); Wed, 23 Mar 2022 13:29:04 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B317B577; Wed, 23 Mar 2022 10:27:35 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id mp6-20020a17090b190600b001c6841b8a52so7059159pjb.5; Wed, 23 Mar 2022 10:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=W5pYT/F8t16XQbM3qlDKbbsJw4C6bC82sHdzEgCXN8E=; b=GDg1zhAMUcNSRBRWchOY916ZL3epaxVmXkOwkuzuKQh27+8rn28+zp63IOtKzzcDaR qJ0EAxLqtGRKCULxFdhyvoZpninXTBjsZhCdm/0zeDl3qMi7Lo910smtr51S5Q4v726y KkIqFYVtaNhSNfrTk9ZdNcPjVI1T50b/UlzKC491rFgm1viTIgUcguLH05dhbBLPfZge 9iYPbqS8mTejy8qW6fRUrZTW1wno+JGhTjr8sc7SDCf0iGMJQ1sWxy7+RuvpMNuwi7RJ +SCn8AHuv0oee4AsUWDGN80dRSJWs3pYHm8ypSAIFIy0zJmP4Dy9U+T6wDPXm8AniFBY v7MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=W5pYT/F8t16XQbM3qlDKbbsJw4C6bC82sHdzEgCXN8E=; b=b9cN6U0UtllqdkwLQDeWtrbqtZj8mHUxep4OHbIE7GfcmIw4Mi/NaIAonRhPshbXLB 0Oa3Co0/I1eKmwD8jVIP869LbcMj8DQWQlnW3S7Mt/rL0JsaFdV5tmld4pUOKIBM4Uxp 8+tRdTdCFw+QuZBCAw6e6QCQq8SaOJeNYuq2te9rcQrrwKHhrQ2NOZVdHlGM8DoY6q+y hX5QLPwGT6IJwmUVDneiztbZeSK9T9Zty86DwYAXkVRnP3BIMXj6NjhGfzz82RJGMzFP vINB7iL+WP6NXV7V/dblYwWkvw+VuzwPwQs4/V6NqcOOyZzljczvXDY02kRynGCWtHQ9 ragA== X-Gm-Message-State: AOAM530aL05TTfj66gahgAJCEdQh/bpFAOpKg6Pne7Hmf69CTJWbFZ+y dr04wTgl6cXLD5yke0hG9ds= X-Received: by 2002:a17:902:cf0e:b0:14f:8a60:475c with SMTP id i14-20020a170902cf0e00b0014f8a60475cmr1176077plg.146.1648056454158; Wed, 23 Mar 2022 10:27:34 -0700 (PDT) Received: from google.com ([2620:15c:202:201:d52a:448a:8e0b:67f1]) by smtp.gmail.com with ESMTPSA id h16-20020a056a001a5000b004fa343c2d0csm491499pfv.136.2022.03.23.10.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 10:27:32 -0700 (PDT) Date: Wed, 23 Mar 2022 10:27:30 -0700 From: Dmitry Torokhov To: "jingle.wu" Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, phoenix@emc.com.tw, "jingle.wu" Subject: Re: [PATCH] Input: trackpoint - Add Suspend mode for Elan TrackPoint Message-ID: References: <20200904024231.26812-1-jingle.wu@emc.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904024231.26812-1-jingle.wu@emc.com.tw> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jingle, On Fri, Sep 04, 2020 at 10:42:31AM +0800, jingle.wu wrote: > From: "jingle.wu" > > Add suspend command for elan trackpoint Could you please elaborate what this mode does to the trackpint? Also, your signed-off-by is missing. > --- > 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, I'd combine the 2 "ifs". > + MAKE_PS2_CMD(3, 0, TP_COMMAND))) { > + psmouse_err(psmouse, psmouse_warn() since it is not a hard error. > + "failed to suspend trackpont.\n"); I'd say "failed to suspend Elan 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 It seems to me that TP_TOGGLE_ELAN_SLEEP is a bit in TP_TOGGLE_BURST subcommand, so it is better to move it next to TP_MASK_BURST and call it TP_MASK_ELAN_SLEEP to match the rest. Thanks. -- Dmitry