Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1976020pxb; Mon, 12 Apr 2021 10:59:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzwP6IJ3uzxxuAduofxx3ST/+pUHvfl6oGK3+eB0f8KZrSXYlR2zTkPdnX2ivv95At1gGf X-Received: by 2002:aa7:95b5:0:b029:1ef:272f:920c with SMTP id a21-20020aa795b50000b02901ef272f920cmr26453364pfk.21.1618250372328; Mon, 12 Apr 2021 10:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618250372; cv=none; d=google.com; s=arc-20160816; b=gYuu9GJnPa2Rgm9LDqJFATHYk0TcikFNZqN8TsdiwVCQBcGkobq/y6QrTgs4nnLE6R zm8LCHwCKJlhcoOzqqlQeIafZnDssDwC4SO8SWMn9sof6W+gMF2qL5dyEgsz/JqopJoN JlMLgD4EBCv/4eoxHNUWaR4unTnwaKOWaOPB4/bZjTi/uuH2VjIUYVnWdM30pcMvyemv Ewyw4JOKEQHzu8BbvauqXL1M1aBIMu5Pruu3/OFhyUk2xgJtXI7x1bNVE32wHQ16vDuE eukAj5x0J0+FDlCe/AJf0jzAeXj7AVT7ObGssOKVYjllOqStFxRYd4CF9fqEDiqktWUw 985g== 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=wQwEibf/qRDlUg9g4tQhhRSZ449db5ajiJyiNZmODrg=; b=ToRXOJ7GrPH14ARFXkkgy+6UjA1yIvyrcfNwcKOFMBijXw249vicB2bY/4t4f78/Rz G65PhqHKOojnPnUhqxkeW1KCOj65NR4ONgu58gFcpe+j+YdJxDeM57nf3VT+lJWyOpCC rh7EdnyLLTbGxrJWEvt7ehkNPTUmE8GsFW8qUf8rQ2JRyfHI1cupCamBbd2NbiovREaY fSpAOp/5iBMt/DXssFFB+jrxp83HAUmUoK+C1GyovX9hrODwBtPQmrmCRIVEymHzchSb bPbVT5X7lpbJPnRZU5T42IXd9GR+7z514B3P47mmhEHDsTVVzZIHq9nVbck9Gc3yqbtv ZXyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NF0WMlfk; 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 lp6si97756pjb.138.2021.04.12.10.59.19; Mon, 12 Apr 2021 10:59:32 -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=NF0WMlfk; 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 S240542AbhDLR6T (ORCPT + 99 others); Mon, 12 Apr 2021 13:58:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239858AbhDLR6S (ORCPT ); Mon, 12 Apr 2021 13:58:18 -0400 Received: from mail-vk1-xa29.google.com (mail-vk1-xa29.google.com [IPv6:2607:f8b0:4864:20::a29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F116C06174A for ; Mon, 12 Apr 2021 10:57:59 -0700 (PDT) Received: by mail-vk1-xa29.google.com with SMTP id u200so473220vku.3 for ; Mon, 12 Apr 2021 10:57:59 -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=wQwEibf/qRDlUg9g4tQhhRSZ449db5ajiJyiNZmODrg=; b=NF0WMlfkqU4i3PEuQLAlg8Jd2mtSsBq+sKarvmeiuUTGAvkyhbK9Iw5aiCTfcy0uPG bpHx67m4h2KPDkvSQKdgd45Gm8JHGlQiPisYhnD3cl1kz47m6e6Q2pqY5xs9si4fGOOU kazpYOw/y1GFkfZiA+tXBLbOXLGzuW/7/rtOI= 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=wQwEibf/qRDlUg9g4tQhhRSZ449db5ajiJyiNZmODrg=; b=GsZ7McWcZDDpHcLwzJiwExlkjGR1Y4fGWnGORfI+94v85umDuoRFlzMVwYGGyv/FOt y3azEGJrD0RrA4rU0eoncNQvfZbrU0ixIE9o6E3vp2H9ZmTnNmrRYDBoew4QMdfEH9Jh P8fnS2DZexPSGTiPU0VkMpPZaJ7GTOeRstwEWaTuOWbZQpw80T3Ifb/WHwUNfjfD8bBi 2XEAvJ1xjL1kyEnTEIQoc2RsUWUp/s318oZFqP34ntCeoABSeIRA+YuVIOp4d+XN2Wup Iqc78NKaFwfdB56Fn7OXZ+yr8yMpVxQks2qJmE1DJv2xtH51z1qcJvSvGxnd5K6rMOrk c1xg== X-Gm-Message-State: AOAM533ddqX6WW8HmOxMzoBCcOTPreehqYuQ7k/x3eyvNzNcFwRXS2E0 ADLnh+mFD8VU67D5dZff4tFWaLtFRfrp9MVh X-Received: by 2002:a1f:53c7:: with SMTP id h190mr21079083vkb.19.1618250278128; Mon, 12 Apr 2021 10:57:58 -0700 (PDT) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com. [209.85.217.47]) by smtp.gmail.com with ESMTPSA id c129sm1254665vkb.21.2021.04.12.10.57.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 10:57:57 -0700 (PDT) Received: by mail-vs1-f47.google.com with SMTP id x14so2406951vsc.5 for ; Mon, 12 Apr 2021 10:57:57 -0700 (PDT) X-Received: by 2002:a67:f595:: with SMTP id i21mr20935076vso.16.1618250277111; Mon, 12 Apr 2021 10:57:57 -0700 (PDT) MIME-Version: 1.0 References: <1618190463-12993-1-git-send-email-johnny.chuang.emc@gmail.com> In-Reply-To: From: Harry Cutts Date: Mon, 12 Apr 2021 10:57:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] 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 Mon, 12 Apr 2021 at 10:56, Harry Cutts wrote: > > On Sun, 11 Apr 2021 at 18:21, 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 > > It's probably a good idea to add a Fixes: tag, like so: > > Fixes: 43b7029f475e ("HID: i2c-hid: Send power-on command after reset") > > Other than that, > > Reviewed-by: Harry Cutts > > Harry Cutts > Chrome OS Touch/Input team > > > --- > > Changes in v2: > > - move comment to quirk entry > > --- > > 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..957d865 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 */ > > @@ -178,6 +179,12 @@ 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 }, > > +/* > > + * Sending the wakeup after reset actually break ELAN touchscreen controller > > + * Add I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET to skip wakeup after reset > > + */ ...though, just spotted, you should indent the comment. > > + { 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 > >