Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp363217pxj; Fri, 7 May 2021 10:14:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVuumtc9vLn7R0XQIc/9R5Il2tDCYhTOGJIdqkQrmScxMDtWibzibD7b2ISZTKjnKb0rbD X-Received: by 2002:a17:906:32d8:: with SMTP id k24mr11355457ejk.156.1620407670897; Fri, 07 May 2021 10:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620407670; cv=none; d=google.com; s=arc-20160816; b=PqzVs6Q2S3v3jqKo5s43WuB6caLedIZMwo/vyuwq3K+4lipduFpkxsb/8101MujmI4 Log1ZllQu8hyNffl4UFHKlIsEyj6VspDoFA8u3jbLXcm7g1yh7bG1ZQKkviMNw3lhItQ k1oTaDK0+5sIS27wqMq/Q8cSllcMe50B2D9DBE68c1ELC5hi2CV+inp8XTcMz2hqa/Gb 6fh7gFiJ569z7QquabYrZxfRwPla0m4yZRfSYhKJ8+7vXn2CITSywycyTlFoa6vMuXIs yxrcRnrTMuRdSamjkJKpEL9Rsi8IfT5JnVnd+9whv/ZfSTYhZK8uGogLbJSTYEz9NJNP XFVg== 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=1lBldkVI1Lz29e5G5ZcuHtAMgpbsiACK1LzJjPj1N0E=; b=kyWj8EbPy535A1BBiKMjxbz6dn3XVA+hnP/N1IYTiIvlji7hTa58/bwpiakhr14XEi b2MlYsRzXbo8lmEHxxRzEMQffbSViXFcV43TnHh3woCdyWxIn6rgUdG92wjWJNFuOQyd GfQZdPjol/Xd7fgSLc3X0v9ioCw0+ggJ0mAQ43tvyA/u+QteXgzsW3lPjgO7rO9M3ZY3 HYtGFQbYg+uikiEzNN7jvo49t/8mviqGX+c1vqJix286uQVwGYl7Z97gZVhbjjasp7DO uDkiCXSvo7lncQSKK72jiwHO4BMYY0S1AJjtxxJKfkqFx3WJMuAxgh0gY135feS+zhGN 3JMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cYmlm2XV; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx23si2016527ejb.149.2021.05.07.10.14.06; Fri, 07 May 2021 10:14:30 -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=@redhat.com header.s=mimecast20190719 header.b=cYmlm2XV; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237290AbhEGNjw (ORCPT + 99 others); Fri, 7 May 2021 09:39:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57568 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236049AbhEGNjw (ORCPT ); Fri, 7 May 2021 09:39:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620394732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1lBldkVI1Lz29e5G5ZcuHtAMgpbsiACK1LzJjPj1N0E=; b=cYmlm2XVt2Tn7ovvlKKyC7o19t9KVJhr41IkaBeo1c5ro3OWrSijjZdW2FKLV65Qxp4J48 bu/OZq3zkBtQF3MIIKxuW7gmYV7s3r5BHoeWMrOgOg82raf7JHlrxRa/skCTS6z52Bkih6 4OrPSPPWcKwXSSBVFUhH6Igh4c0R1Z0= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-pMTVdwy0Ptyu2aJpR3rJMQ-1; Fri, 07 May 2021 09:38:48 -0400 X-MC-Unique: pMTVdwy0Ptyu2aJpR3rJMQ-1 Received: by mail-pg1-f197.google.com with SMTP id g5-20020a63f4050000b02901f6c7b9a6d0so5426985pgi.5 for ; Fri, 07 May 2021 06:38:48 -0700 (PDT) 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=1lBldkVI1Lz29e5G5ZcuHtAMgpbsiACK1LzJjPj1N0E=; b=B3ELsavBaBK/oMPKNfs92VGwQNf81TtYh8DgCD7OvwtsKoxSUA6cH+vC7O2q45Qypc QQHAFdICTKZuMOPJwMZcDjglX8NX5Lh3TrRMUsOzTApJnTL/5uL/aqdx3KtBq3lGkDNE h2B6qjmwIDi0+bE42Y19RunomMBWSSbYK3FqfMjoPKk5/uct3xfozMFaE7ILm7HemdHq 5uUjLKMwXoiaxofreZuy+hE9at6ZaK4hPpIQEsUO1SYkRDewsp8UZK2QlG3Htinui7p+ wG6fHtlGlMxIxsPBQ2ywvol6ARiUlrxyCxHlYRZ7O+/SfzHMrEU+vdajFUqZjPlCPG8G 8pIQ== X-Gm-Message-State: AOAM5308G7Y9ihD1a2qHQJ4WUAt0hn393qx9I6kZ9fmPAQGOV/G/C9go MD4dBT6hNV5RtUPDq1jgFDQOwpj2zKD9R/tAbFJeMZzkAhyrHA7bLQwd5O4gGzGity7miQzSNip WigiMfDAjRo/oGHqf7aJuPpYZuNWUO7mVMICHY8wA X-Received: by 2002:a17:90a:bb0c:: with SMTP id u12mr10768507pjr.234.1620394727616; Fri, 07 May 2021 06:38:47 -0700 (PDT) X-Received: by 2002:a17:90a:bb0c:: with SMTP id u12mr10768485pjr.234.1620394727364; Fri, 07 May 2021 06:38:47 -0700 (PDT) MIME-Version: 1.0 References: <1618276850-27178-1-git-send-email-johnny.chuang.emc@gmail.com> In-Reply-To: <1618276850-27178-1-git-send-email-johnny.chuang.emc@gmail.com> From: Benjamin Tissoires Date: Fri, 7 May 2021 15:38:36 +0200 Message-ID: Subject: Re: [PATCH v3] HID: i2c-hid: Skip ELAN power-on command after reset To: Johnny Chuang Cc: Dmitry Torokhov , Peter Hutterer , lkml , "open list:HID CORE LAYER" , Harry Cutts , 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 Hi Johnny, Apologies fo the delay. When I first saw your patch I wondered why we need a special case for Elan. But then, we need a special case for SIS, as mentioned by 43b7029f475e. Given that this patch was in for a year and a half, and not many people seemed to complain about it, I decided to apply your patch. On Tue, Apr 13, 2021 at 3:21 AM Johnny Chuang wrote: > > Fixes: 43b7029f475e ("HID: i2c-hid: Send power-on command after reset"). As requested per Doug, I have moved that Fixes tag at the end, though I forgot to remove the extra '.' at the end :-( > > 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 > --- > Changes in V3: > - intent the comment at qurik entry > - add Fixes:flag for previous commit id > > 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..32e3287 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 I removed that extra second line. Also added Cc: stable, and pushed to for-5.13/upstream-fixes Cheers, Benjamin > + */ > + { 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 >