From patchwork Sat Dec 19 04:47:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bla=C5=BE_Hrastnik?= X-Patchwork-Id: 11983311 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4BBCC4361B for ; Sat, 19 Dec 2020 04:47:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F2B623BE2 for ; Sat, 19 Dec 2020 04:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726310AbgLSErI (ORCPT ); Fri, 18 Dec 2020 23:47:08 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36319 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbgLSErI (ORCPT ); Fri, 18 Dec 2020 23:47:08 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3FAC85C00CB; Fri, 18 Dec 2020 23:46:02 -0500 (EST) Received: from imap22 ([10.202.2.72]) by compute2.internal (MEProxy); Fri, 18 Dec 2020 23:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxxn.io; h= mime-version:message-id:date:from:to:subject:content-type :content-transfer-encoding; s=fm1; bh=nC0KoqiKl38hyjl3b0YXmDOFpA 9kO4GqxnDV3PcLu9Y=; b=aqr/PAzP12MrJvTKOGS9rabY0JgqlAsLGNVw0uJWSX Gj5YCsHmZzRwExbrmRAS6FJR3UCUWzYQkFt/CaDH1BnSAmYUyeBRT1NVKY7s59I6 C+bDMjHohEoVJIWUp81mZstZr7WaVnVGxx53QN6HOocksVD4U4C6rhXCHMNigYLQ wVb0x/n5mgT8/YrF/P7D7RGljMLzYdfwH2VlGy5xkhjFNWi4Gl9HrJtT58uFx7Pr u8zlChAwVXiMPVSTKQ0DmuVoR5lIWlyTciQcJJ8A6UCcw1QyKWqW7p7FiUqJ9gKQ tSDnYAiCtSwEfD5N/KDgFQ9gnS79qUbCY+d5CufFkUag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nC0Koq iKl38hyjl3b0YXmDOFpA9kO4GqxnDV3PcLu9Y=; b=i3cwHf0EYSwrUNRpW3cKeg gLJoxwQ/iYdcO6f3xrXeOTvwXRlcQQTCkds0f5c6kDbEVSeYnqCC5EFTmvrBmcQ8 v3iWoqRsLd497ijN/qC+H+7BGMY7k5CDUmjBz62p+TcXeyeT5U/I3+DfW5xvNcAn KUEAGi2PPOO6SyFJlMtq8lY/dyaPA3Qo1TxB9luHgpHrKmymEkIib2Kmy+h1Eu4s Y1Fg/iDxRO63IYzcF6fOm0kmOxF/qrAWohGck367kkGUVXIhnNwrZnHJekg0Lu46 ayhwBP7eWLoXQoTfw0fMWIPrcoGysMqdEL1Ej88yTkA1B+ExbHo6l3oqRpy6tjOQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeljedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkfffhvffutgfgsehtqhertderreejnecuhfhrohhmpeeulhgrkkgp jfhrrghsthhnihhkuceosghlrgiisehmgiignhdrihhoqeenucggtffrrghtthgvrhhnpe dvteekleduieduuddvieejvdehveffhfevjeevkedtfeeiuddufeefveevlefhvdenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegslhgriiesmh iggihnrdhioh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5EF8A62A005E; Fri, 18 Dec 2020 23:45:26 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.1-61-gb52c239-fm-20201210.001-gb52c2396 Mime-Version: 1.0 Message-Id: <2b4c5881-2047-407f-8bb4-623d9bd167c7@www.fastmail.com> Date: Sat, 19 Dec 2020 13:47:41 +0900 From: =?utf-8?q?Bla=C5=BE_Hrastnik?= To: "Jiri Kosina" , "Benjamin Tissoires" , linux-input@vger.kernel.org Subject: HID: multitouch: Set to high latency mode on suspend. Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Per Windows Precision Touchpad guidelines: > The latency mode feature report is sent by the host to a Windows > Precision Touchpad to indicate when high latency is desirable for > power savings and, conversely, when normal latency is desired for > operation. > > For USB-connected Windows Precision Touchpads, this enables the device > to disambiguate between being suspended for inactivity (runtime IDLE) > and being suspended because the system is entering S3 or Connected > Standby. The current implementation would set the latency to normal on device initialization, but we didn't set the device to high latency on suspend. Signed-off-by: Blaž Hrastnik --- drivers/hid/hid-multitouch.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index d670bcd57..28bac0f39 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1746,6 +1746,13 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) } #ifdef CONFIG_PM +static int mt_suspend(struct hid_device *hdev, pm_message_t state) +{ + /* High latency is desirable for power savings during S3/S0ix */ + mt_set_modes(hdev, HID_LATENCY_HIGH, true, true); + return 0; +} + static int mt_reset_resume(struct hid_device *hdev) { mt_release_contacts(hdev); @@ -1761,6 +1768,8 @@ static int mt_resume(struct hid_device *hdev) hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE); + mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true); + return 0; } #endif @@ -2150,6 +2159,7 @@ static struct hid_driver mt_driver = { .event = mt_event, .report = mt_report, #ifdef CONFIG_PM + .suspend = mt_suspend, .reset_resume = mt_reset_resume, .resume = mt_resume, #endif