Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1298737pxj; Wed, 19 May 2021 02:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzR31DnKOmDB7fIhrTX/m4OU3tg5IiFjO2kbZWp9iprbT78PoqR0ZWvqQZSt/jDL52IEer X-Received: by 2002:a92:cdac:: with SMTP id g12mr9706242ild.72.1621418034892; Wed, 19 May 2021 02:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621418034; cv=none; d=google.com; s=arc-20160816; b=q76pXVvvm5aHfyKxXD9N7Z+yS5fXW7Vmgmy3UzzIgf75QCXonWttsWZlW0Nffq2c7X Y+NzUXD96JU9IexMdv+ijL5wdfdxh52mZPrCijOin/QVq01NeZCdPpEzL+VSdplLA2Zb v6Ze3FpKkEkyaKKQ4F0BzEmJtRZ6znmNRTc3POvPJ52pI+WMucqFt6yn2Hd/oG7OZS8u ytejFh9dcQv0PORfxpawtbRZEKOX/95QrFgkpBwuc2txmuDo9aUnSRNAMy9PI1i15NhD nqlL3OgLc57sDl5sigHRuGFrijEGCzaqn+HqG7JtrAPH1IaxRkwKiV+39X+Q3pctQdu0 YMdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=KCfTLComXDS1Yer36Bsp0w514jut41fe9qR5dcREKPo=; b=PI84FSHbli4ruOORqpQRCyAbpKdc8WdKaCduSERfKB/SfimfLAlRCwLH/GVaQF1rmR 5gPXMGJkum4vka9At8bciAaDKcSMdnEXePO8UuFvnTSvL3eRkv2/fCYkHzELOcwG7yTv k/DUr0JziosU/FvOBB01THdiZRRhRcsoPs2ZonogZgJUzMv2p3fQKBmZbAEFtN4z/HmK JVtnATEr9px/mzAWpgBfAPeMX0SNXwDEp0xnADHLW0LQiIzZfV3od9qgGm3GN04tV6jw iqi958EAg54k8jLp9VGfV7pyDwnvxR2LE8ZkmXBJy0Z/vV2oGaATWJZ+3vutyPTxK2kv YkCw== 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 w12si2766092ill.144.2021.05.19.02.53.42; Wed, 19 May 2021 02:53:54 -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 S1344664AbhERBJO convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 May 2021 21:09:14 -0400 Received: from emcscan.emc.com.tw ([192.72.220.5]:42182 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239795AbhERBJO (ORCPT ); Mon, 17 May 2021 21:09:14 -0400 X-IronPort-AV: E=Sophos;i="5.56,253,1539619200"; d="scan'208";a="40764566" Received: from unknown (HELO webmail.emc.com.tw) ([192.168.10.1]) by emcscan.emc.com.tw with ESMTP; 18 May 2021 09:07:54 +0800 Received: from 192.168.10.23 by webmail.emc.com.tw with MailAudit ESMTP Server V5.0(177985:0:AUTH_RELAY) (envelope-from ); Tue, 18 May 2021 09:07:54 +0800 (CST) Received: from 192.168.55.71 by webmail.emc.com.tw with Mail2000 ESMTPA Server V7.00(2473:3:AUTH_LOGIN) (envelope-from ); Tue, 18 May 2021 09:07:53 +0800 (CST) From: "Johnny.Chuang" To: "'Harry Cutts'" , "'Johnny Chuang'" Cc: "'Dmitry Torokhov'" , "'Benjamin Tissoires'" , "'Peter Hutterer'" , "'lkml'" , "'linux-input'" , "'James Chen'" , "'Jennifer Tsai'" , "'Paul Liang'" , "'Jeff Chuang'" , "'Douglas Anderson'" , "'Jingle'" , "'Paris Yeh'" , "'sukumar . ghorai'" References: <1621295824-12730-1-git-send-email-johnny.chuang.emc@gmail.com> In-Reply-To: Subject: RE: [PATCH] HID: i2c-hid: Add I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON to optimize timing Date: Tue, 18 May 2021 09:07:53 +0800 Message-ID: <089701d74b82$3b0c1c00$b1245400$@emc.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKTds7H4vJlViKUoEQ2K8NJpxt9xgIFo9jjqV/oReA= Content-Language: zh-tw x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcMDUwMTBcYXBwZGF0YVxyb2FtaW5nXDA5ZDg0OWI2LTMyZDMtNGE0MC04NWVlLTZiODRiYTI5ZTM1Ylxtc2dzXG1zZy03ODgyODQxOS1iNzc1LTExZWItODY2Mi03YzVjZjg3NDk0NzhcYW1lLXRlc3RcNzg4Mjg0MWItYjc3NS0xMWViLTg2NjItN2M1Y2Y4NzQ5NDc4Ym9keS50eHQiIHN6PSIyNDAyIiB0PSIxMzI2NTc3MzY3MzYyNzYxNTYiIGg9IlpXYng0VXJYT0lKRnp4WmtPdjE1NWpWRk9mOD0iIGlkPSIiIGJsPSIwIiBibz0iMSIvPjwvbWV0YT4= x-dg-rorf: true Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, 17 May 2021 at 16:57, Johnny Chuang > wrote: > > > > There is a hard coding 60ms delay after I2C_HID_PWR_ON commadn. > > Elan didn't need the delay, so we add a quirk to reduce boot time and > resume time. > > > > Optimized: eef4016243e9("HID: i2c-hid: Always sleep 60ms after > > I2C_HID_PWR_ON commands") > > I don't think Optimized: is a valid commit tag, though I'm not sure if it'll cause > any problems. I will change to Fixed tag at PATCH v2. > > > > > Signed-off-by: Johnny Chuang > > --- > > drivers/hid/i2c-hid/i2c-hid-core.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c > > b/drivers/hid/i2c-hid/i2c-hid-core.c > > index 9993133..e7ec280 100644 > > --- a/drivers/hid/i2c-hid/i2c-hid-core.c > > +++ b/drivers/hid/i2c-hid/i2c-hid-core.c > > [...snip...] > > @@ -178,6 +179,11 @@ static const struct i2c_hid_quirks { > > I2C_HID_QUIRK_RESET_ON_RESUME }, > > { USB_VENDOR_ID_ITE, > I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720, > > I2C_HID_QUIRK_BAD_INPUT_SIZE }, > > + /* > > + * Optimize boot time and resume time > > + */ > > This comment is a bit too vague to be useful; maybe state that Elan devices > don't need the delay instead, or just remove the comment. > > Other than that, Okay, I will change to Elan devices don't need the delay at PATCH v2. > > Reviewed-by: Harry Cutts > > > + { USB_VENDOR_ID_ELAN, HID_ANY_ID, > > + I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON }, > > { 0, 0 } > > }; > > > > @@ -427,7 +433,8 @@ static int i2c_hid_set_power(struct i2c_client *client, > int power_state) > > * PWR_ON requests. Testing has confirmed that several devices > > * will not work properly without a delay after a PWR_ON > request. > > */ > > - if (!ret && power_state == I2C_HID_PWR_ON) > > + if (!ret && power_state == I2C_HID_PWR_ON && > > + !(ihid->quirks & > I2C_HID_QUIRK_NO_DELAY_AFTER_PWR_ON)) > > msleep(60); > > > > return ret; > > -- > > 2.7.4 > >