Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1529552pxf; Fri, 9 Apr 2021 10:35:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysyo9woBwHEwEWi0bDR+I+S8eaD6jiWB/8tnByJ0W1N1InqQrJ+2HpZTjw7+fWMLAj6d6v X-Received: by 2002:a62:ab0e:0:b029:1f6:2620:d6a8 with SMTP id p14-20020a62ab0e0000b02901f62620d6a8mr13217640pff.13.1617989716397; Fri, 09 Apr 2021 10:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617989716; cv=none; d=google.com; s=arc-20160816; b=AqFzv2DtwHdTagWG0dWAu0YIbb5FV4dBh/F0gKlrFUHj+P45F1Afz1MqplMTznC26T UxJS005tciCWXp7s51kj25/v4hHIuLNBwU7g0N2eETQXGqepChwexaxA+djuIh7w/tpA o/1CINJlnhK80SbYV7pJFO9p6+sV90U9HpfuAFKd37H10c3XSgT54GN8qPoskyUGuPZo iDXv0QcTl/rgbG24vUL0+/Wflez96cvMCFfsA5RYiqomyGgL1U5Fjr18/mcrQ5NIoX06 slYE2RamhAXlAFOMBBHytaJQJj2lbDS3mwsdnm1jjjUuJorqT9tBdkSL0Fd6QB9fpAsw EN9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oabdM8jRxHNDcjomZqbQRjSlgoKt15wAzyQGzFiwnNw=; b=hnOdhwUxaLoGEtaZbWt7pHK6x5Z5QxML9JKPJteqxDVQf8DZjmdFShxl9mRd50PFtP b2B1z0lZKs8+YtaDrfjYXI+1ox+/3dCO1eRAo47/4BBRASjHYLAqVHlq2ymmr6V8Cbh+ QDuULhv9tvd0WugCXjflCcNeRrND4N/6EY4cv9oEfQ/KK9waKQhUcCUFs9umAC5Isjhl K8fK60qiixqwQ7FKsJPTDD9WFYNeGNRXRT0Q1v/zNbUgZBvrUrxTCE5vbK1lEZv+bmhs GKz0mCjJH5FmnTIaEebEfK7wXVBT2QHSrmoNvuxf+Gdfac2XoCeiQIvePFCT5U92oFj+ Cujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="BwX/YPvs"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a185si2427464pfb.69.2021.04.09.10.35.02; Fri, 09 Apr 2021 10:35:16 -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; dkim=pass header.i=@chromium.org header.s=google header.b="BwX/YPvs"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234334AbhDIRdU (ORCPT + 99 others); Fri, 9 Apr 2021 13:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234250AbhDIRdS (ORCPT ); Fri, 9 Apr 2021 13:33:18 -0400 Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F8BC061761 for ; Fri, 9 Apr 2021 10:33:05 -0700 (PDT) Received: by mail-ua1-x92c.google.com with SMTP id z23so898839uan.8 for ; Fri, 09 Apr 2021 10:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oabdM8jRxHNDcjomZqbQRjSlgoKt15wAzyQGzFiwnNw=; b=BwX/YPvs1OM4ve4WFxiRz+9C6cY4rhSvlDXWbnqT2g9Dy3ic1FdirzwvJkmnOx7K/m 1lfLwV/RMnDmcOZL6MEVM+O56lcYlgcq4Le21TXLQfUAUZ4qF0SyM+jkEJGF7WlPHOTp uamBsSUhRBHdb7eJWIbK9yoSq0yY0ZtViDoAU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oabdM8jRxHNDcjomZqbQRjSlgoKt15wAzyQGzFiwnNw=; b=NhwOMl1mCihsvGG5H418EhZsRxg/Mpo/qv0K3pMV+FdeZPNEFS8lcgtjX9RcD+Co0Z hMYGOyG/MuOphfIu0U6o4qRRPm1eBG8Lr721PzvQq3lewyilYMJt9SHLviQWQXIBjLZ+ MtWXG844r8DQDSH3r4vJ8Vi5eX9WKjwb/xw5rxHyUQDkkOCct9KlqYjBP/F6ihtsrRVL fKHXHtbKMgO/umxLP/iJkPX353KiHEpOeIexogBDcnS+jfckdJ32uZIEACCQC8+w0NSF gmMJYFJ9Uvfbzxn1ZAAcPPEfdstWQnV89qh8twdVr1bg7NJgGEBp9CINf4UyKfskRpSs vZTg== X-Gm-Message-State: AOAM530Drsr+zSo5yHZiid/gv5gBO7PluyH5wjSIOfoDeSnVUKCz3/3M GLCKGSJrXoRAGPA/WjuEc7tZpknZr0OuPMtR X-Received: by 2002:ab0:7317:: with SMTP id v23mr12227797uao.9.1617989584255; Fri, 09 Apr 2021 10:33:04 -0700 (PDT) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id j124sm310185vke.32.2021.04.09.10.33.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Apr 2021 10:33:03 -0700 (PDT) Received: by mail-vs1-f48.google.com with SMTP id k124so3317428vsk.3 for ; Fri, 09 Apr 2021 10:33:03 -0700 (PDT) X-Received: by 2002:a67:d994:: with SMTP id u20mr12243960vsj.29.1617989582125; Fri, 09 Apr 2021 10:33:02 -0700 (PDT) MIME-Version: 1.0 References: <1617778157-11007-1-git-send-email-johnny.chuang.emc@gmail.com> In-Reply-To: <1617778157-11007-1-git-send-email-johnny.chuang.emc@gmail.com> From: Harry Cutts Date: Fri, 9 Apr 2021 10:32:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] HID: i2c-hid: Skip ELAN power-on command after reset To: Johnny Chuang Cc: Dmitry Torokhov , Benjamin Tissoires , Peter Hutterer , lkml , linux-input , Johnny Chuang , James Chen , Jennifer Tsai , Paul Liang , Jeff Chuang , Douglas Anderson , Jingle Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Apr 2021 at 23:49, Johnny Chuang wrote: > > Previous commit 43b7029f475e ("HID: i2c-hid: > Send power-on command after reset"), it fixed issue for SIS touchscreen. > > For ELAN touchscreen, we found our boot code of IC was not flexible enough > to receive and handle this command. > Once the FW main code of our controller is crashed for some reason, > the controller could not be enumerated successfully to be recognized > by the system host. therefore, it lost touch functionality. > > Add quirk for skip send power-on command after reset. > It will impact to ELAN touchscreen and touchpad on HID over I2C projects. > > Signed-off-by: Johnny Chuang > --- > drivers/hid/i2c-hid/i2c-hid-core.c | 10 +++++++++- > 1 file changed, 9 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..6b407f7 100644 > --- a/drivers/hid/i2c-hid/i2c-hid-core.c > +++ b/drivers/hid/i2c-hid/i2c-hid-core.c > @@ -45,6 +45,7 @@ > #define I2C_HID_QUIRK_BOGUS_IRQ BIT(4) > #define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5) > #define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(6) > +#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(7) > > > /* flags */ > @@ -157,6 +158,10 @@ struct i2c_hid { > struct i2chid_ops *ops; > }; > > +/* > + * Sending the wakeup after reset actually break ELAN touchscreen controller > + * So add I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET to skip wakeup after reset > + */ You should put this comment next to the quirk entry itself, since it doesn't apply to the whole list. > static const struct i2c_hid_quirks { > __u16 idVendor; > __u16 idProduct; > @@ -178,6 +183,8 @@ 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 }, (comment should go here) > + { USB_VENDOR_ID_ELAN, HID_ANY_ID, > + I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET }, > { 0, 0 } > }; > > @@ -461,7 +468,8 @@ static int i2c_hid_hwreset(struct i2c_client *client) > } > > /* At least some SIS devices need this after reset */ > - ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); > + if (!(ihid->quirks & I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET)) > + ret = i2c_hid_set_power(client, I2C_HID_PWR_ON); > > out_unlock: > mutex_unlock(&ihid->reset_lock); > -- > 2.7.4 >