From patchwork Wed May 24 03:42:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 98269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2575459vqo; Tue, 23 May 2023 20:50:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LHUegjbeIFbimyQ/FbvOLOPlYmttwADmHA1XxX9liCfRD8ZH1F5bcCksXJMRY2MHZ4AoL X-Received: by 2002:a05:6a20:1590:b0:101:8b:43a5 with SMTP id h16-20020a056a20159000b00101008b43a5mr18553596pzj.8.1684900236839; Tue, 23 May 2023 20:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684900236; cv=none; d=google.com; s=arc-20160816; b=FCBU/c4MTPTxECkqqaxg7U3XmrUdD8TbCh9MzOlKZg5njS0mA8zLJDduy7DZROXOOe 8p8YmXcwW+JwMaEu8ZDP8gvq3hfPYxouMS76H/0eCMN0ucWph+1XysRjNxhHCewzxumS A9xULHu2aDIHwdjjKksPhjRTsdo7DK1WPTWZ1PP5Ip9cJ0TBA9kdX8SrxyjIuSJNlqcy zFzRAPW99mqEeljrGS1FIzO9YlQi9M0qLPW46PPvTt/G9W0v8e21F+gYHBxzaWWwXHfy OimRNspZOB1KYojyn30BFaBFNptINLx7rDXyg86MZd3JWwMzOxzt9RTPT+w3x3N4d+TJ PMrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0ynAa7x9o82bh71ClmeyjXXrZJrP7PlGAXE4hWpq/+Q=; b=B1qRR7qxAUVO5ffd3YxmZ6HoJy3K9CgUxkRpoPCMmH+MVbMLL+m9rDvPCgDQ4V3tTs /8c+EChhkAGtt2OaQTeh3ik1JuWQ0cuJ+lHi8xV5VPrI1ZUjdwmQ647t2X+NH4Iojrc+ H83ItVwEAO6Ha0+7od8B2Ck3KxZ90Aq7MUurkFAfrxzvhTbJzbpFotjefJmsJwix18W+ gJrKR7EMPWlh+TjXPzN8cJ1X1nGv5vZZF5B15M8rUPXD7Um+CSMc7uQsDPCwVzmpYcwG s6RqJD1IK82aYFSOcONq98wt+CRqAjZlWaszgYvyZJ5jvSOIGiEYX5BEvgHQm7NOUFYX 0WxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KvLMYd02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a633301000000b0050309caf60esi7735735pgz.750.2023.05.23.20.50.24; Tue, 23 May 2023 20:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KvLMYd02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239350AbjEXDpW (ORCPT + 99 others); Tue, 23 May 2023 23:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239335AbjEXDpS (ORCPT ); Tue, 23 May 2023 23:45:18 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38DF4C1 for ; Tue, 23 May 2023 20:45:16 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-64d5b4c400fso366006b3a.1 for ; Tue, 23 May 2023 20:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684899915; x=1687491915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0ynAa7x9o82bh71ClmeyjXXrZJrP7PlGAXE4hWpq/+Q=; b=KvLMYd02H/jW6tjlV8NoTqU4pYbvpat83NrsuNc3YgzZq3DDElxACzaVQSRh3twWDb CrKE4tFWnxzp2Fs/XWRNHJiY6Qf49eRaPSF2YsQcYiTR6vHJs9Nj+eO9SYJ0srunNdwF pSTslBDyq73t+QYu8PRMSH+gpscB5Vxsto2Mk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684899915; x=1687491915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0ynAa7x9o82bh71ClmeyjXXrZJrP7PlGAXE4hWpq/+Q=; b=Ms4+6F7fg2on9YvDPHPiMz1lQgCT381tWjkSLLZL087fklix033d7HFmTxBC8+qbpK 02EERpFeMHnrCDHYrV1hVBzrBpLHw1F4zSxAlP7RDuAi2aYYDbb8F0bIzXoF8ojEWFTw x5VNKucfxySVxYCxiYzsYqjB76afn+c14UJrmag54lnjhKx+hUwiPdG791JJjFjIqvl7 S8+4ZLN9rOyT52ojKHqtZVspTg3/0Sx+VOz9t2LCMpFh4tz/YSPkvKNVoiuomfwkXVDj 8iKSlrQ5IC/xtQHeSTzVwbWyNZAy+9FoPhGZjE9q6A/aa3JE2uVemAb6oKxfqfpXFAyJ K51g== X-Gm-Message-State: AC+VfDwXTcVm0MPb1w1aAfzZQxrzKKoBDeZmLBEfuh4DgJAweXcXAc89 WFJO5aTKv5ZYCa3CHxKDsfbNnA== X-Received: by 2002:a05:6a00:23c8:b0:62a:d752:acc5 with SMTP id g8-20020a056a0023c800b0062ad752acc5mr1573806pfc.32.1684899915747; Tue, 23 May 2023 20:45:15 -0700 (PDT) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:3b18:4c0c:a178:5536]) by smtp.gmail.com with ESMTPSA id d3-20020aa78683000000b0064cb1fe7e44sm6357616pfo.219.2023.05.23.20.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 20:45:15 -0700 (PDT) From: Fei Shao To: Jiri Kosina Cc: Rob Herring , Matthias Brugger , Jeff LaBundy , Douglas Anderson , Fei Shao , Rob Herring , Conor Dooley , Dmitry Torokhov , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v4 1/2] dt-bindings: input: goodix: Add "goodix,no-reset-during-suspend" property Date: Wed, 24 May 2023 11:42:36 +0800 Message-ID: <20230524114233.RESEND.v4.1.Idaa807e609fb3c322b96209c50f71d260917c7be@changeid> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230524114233.RESEND.v4.2.I424e840ae6de3cdbd67394cf4efd24534f6434ba@changeid> References: <20230524114233.RESEND.v4.2.I424e840ae6de3cdbd67394cf4efd24534f6434ba@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766745950713640621?= X-GMAIL-MSGID: =?utf-8?q?1766745950713640621?= We observed that on Chromebook device Steelix, if Goodix GT7375P touchscreen is powered in suspend (because, for example, it connects to an always-on regulator) and with the reset GPIO asserted, it will introduce about 14mW power leakage. To address that, we add this property to skip reset during suspend. If it's set, the driver will stop asserting the reset GPIO during power-down. Refer to the comments in the driver for details. Signed-off-by: Fei Shao Suggested-by: Jeff LaBundy Reviewed-by: Douglas Anderson Reviewed-by: Matthias Brugger Reviewed-by: Jeff LaBundy Acked-by: Rob Herring --- Changes in v4: - Rebase on top of next-20230523 - Collect the review tags Changes in v2: - Use a more accurate property name and with "goodix," prefix .../devicetree/bindings/input/goodix,gt7375p.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml index ce18d7dadae2..1edad1da1196 100644 --- a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml +++ b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml @@ -43,6 +43,15 @@ properties: itself as long as it allows the main board to make signals compatible with what the touchscreen is expecting for its IO rails. + goodix,no-reset-during-suspend: + description: + Set this to true to enforce the driver to not assert the reset GPIO + during suspend. + Due to potential touchscreen hardware flaw, back-powering could happen in + suspend if the power supply is on and with active-low reset GPIO asserted. + This property is used to avoid the back-powering issue. + type: boolean + required: - compatible - reg From patchwork Wed May 24 03:42:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 98270 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2579343vqo; Tue, 23 May 2023 21:02:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7GGctRUSiVfZO7xbP5Y5FjT+7k53F+7LPPUSp8RTESOHo67/LR8Tsze7ER4qww5hFd3ETK X-Received: by 2002:a05:6a00:180d:b0:63a:ea82:b7b7 with SMTP id y13-20020a056a00180d00b0063aea82b7b7mr1245962pfa.28.1684900935195; Tue, 23 May 2023 21:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684900935; cv=none; d=google.com; s=arc-20160816; b=Xvliu+lDKIr4JV77smqxHIgO56j+EZ+txP3c9tanvA7BHVQzD1C9BxfYdKgzuSJgGE p2iJ7LxxjHffOnLB7wwRRgHymXU5XvwvkIF2AaF5B/B/yECrL2ykLxvoRR27bntkNuUB R2YDQ3Ptho++p7ZmuKBEtr9GrW50t3s+pLJwUz8KU+Jy2Y2h9qiZvzveIANLBf2ELIR0 Z8sH+TPICZ5XBSYVAEqd1rmqXtuZjrJZHUfKucKPPN+RcdMraPjT0qSuFUwKe8c1uMI/ sSP3inp6n3T5iHFdTUZFcNz1KA2kjKGEWNn1mzntcSoNWqP8QaDE+r0aVeAUkq6IUh7f +o8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mNAx86DC0MbJEeALPDvpUMasnonSntghXNH2OAhpxaM=; b=k8l7b/NUTL8kL3AgZ5sOaJim2dhrUhWbrTDn8eEGMkKQwydLNfwk5rzO6OTnnr1FdT iy+wzp3zVJg7XWvtyf4gRy3Ezr6QsnUCxuG0/5Ff9hcRbOTCUje0FUwh6p8vMnenpkrd GIJ2wLZfU3z8S6xpZNIraJjdTJObd3LZScHi6v/0AaiRFJchnMAQqr1Vf3ZgJYPyHKDF f3K3N1VAfFMZfO8HU1wpCW+AmFsXgv1GzoVPcxj4PTPdW+3VDKnNIfIfuT/sangVwZmy v1Zrmlt3IePBc2GbNO5aEjsZ9W3OJdwCqu6lVfXlZVmS5nezioHChPJdX8Q49Oru+W8T POjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RtKZkyqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020aa79506000000b0063b7f1ed115si6018500pfp.167.2023.05.23.21.01.48; Tue, 23 May 2023 21:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RtKZkyqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239359AbjEXDp0 (ORCPT + 99 others); Tue, 23 May 2023 23:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239328AbjEXDpT (ORCPT ); Tue, 23 May 2023 23:45:19 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CEFEE8 for ; Tue, 23 May 2023 20:45:18 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d18d772bdso382814b3a.3 for ; Tue, 23 May 2023 20:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684899918; x=1687491918; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mNAx86DC0MbJEeALPDvpUMasnonSntghXNH2OAhpxaM=; b=RtKZkyqNLvMx8iPH0pj6iwQFHl015JFQI3TE7qXpfm0+J4nWvloy56LofH+EoS3TP2 fuYdgY9vVgXAPiA8ntzrE1ufVBOG0ah5OwOtuOCqhH0AtxXf3w5Yz392c0cbAW36prlX WbrIOn4nLiGngXLu6jH8FLXbTnqeNNfKojIBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684899918; x=1687491918; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mNAx86DC0MbJEeALPDvpUMasnonSntghXNH2OAhpxaM=; b=ZGndFXA4avd5AuEvtN8uFj7DjnYGWjDQxe8DPOjlezPzi912uygOFcG00u52O7m7c9 hgBViip7mSigiiQfoNp+T0inN9hSQex/Gb0/pNod81dmypYw6Xmht3wr0T99m4iaeFg9 lrl5bADct1GAyF9RJIraAB4h6Cj/1+0LMPFhVuLzp2dq4qSQUy0b6owfYDa0wpTPlW5C VLQj3xXbgI2xD+/ufmKQErqNJeP8NzGSLY7dGWNG9+h86zVG1FJHHdFL2IKagUDdEqrx +FPwubKxVHU6UVT122IThmQHUdtgmwqTdtRR2l8mgOd9TDqNUmfVGvHyGybKhG14J11v vQhA== X-Gm-Message-State: AC+VfDxzyw4VU+JN0Cg3TckhYe7xylGwIyemV/FtLzz6q+70j95YmwEK ctSbsgsRHAFl3imyvYJLRx3DBg== X-Received: by 2002:a05:6a00:2488:b0:643:980:65b with SMTP id c8-20020a056a00248800b006430980065bmr1773437pfv.2.1684899918278; Tue, 23 May 2023 20:45:18 -0700 (PDT) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:3b18:4c0c:a178:5536]) by smtp.gmail.com with ESMTPSA id d3-20020aa78683000000b0064cb1fe7e44sm6357616pfo.219.2023.05.23.20.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 20:45:17 -0700 (PDT) From: Fei Shao To: Jiri Kosina Cc: Rob Herring , Matthias Brugger , Jeff LaBundy , Douglas Anderson , Fei Shao , Benjamin Tissoires , Dmitry Torokhov , Matthias Kaehlcke , Stephen Kitt , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v4 2/2] HID: i2c-hid: goodix: Add support for "goodix,no-reset-during-suspend" property Date: Wed, 24 May 2023 11:42:37 +0800 Message-ID: <20230524114233.RESEND.v4.2.I424e840ae6de3cdbd67394cf4efd24534f6434ba@changeid> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230524114233.RESEND.v4.2.I424e840ae6de3cdbd67394cf4efd24534f6434ba@changeid> References: <20230524114233.RESEND.v4.2.I424e840ae6de3cdbd67394cf4efd24534f6434ba@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766746683235975091?= X-GMAIL-MSGID: =?utf-8?q?1766746683235975091?= In the beginning, commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator") introduced a change to tie the reset line of the Goodix touchscreen to the state of the regulator to fix a power leakage issue in suspend. After some time, the change was deemed unnecessary and was reverted in commit 557e05fa9fdd ("HID: i2c-hid: goodix: Stop tying the reset line to the regulator") due to difficulties in managing regulator notifiers for designs like Evoker, which provides a second power rail to touchscreen. However, the revert caused a power regression on another Chromebook device Steelix in the field, which has a dedicated always-on regulator for touchscreen and was covered by the workaround in the first commit. To address both cases, this patch adds the support for the new "goodix,no-reset-during-suspend" property in the driver: - When set to true, the driver does not assert the reset GPIO during power-down. Instead, the GPIO will be asserted during power-up to ensure the touchscreen always has a clean start and consistent behavior after resuming. This is for designs with a dedicated always-on regulator. - When set to false or unset, the driver uses the original control flow and asserts GPIO and disables regulators normally. This is for the two-regulator and shared-regulator designs. Signed-off-by: Fei Shao Suggested-by: Douglas Anderson Reviewed-by: Douglas Anderson Reviewed-by: Jeff LaBundy --- Changes in v4: - Minor coding style improvement Changes in v3: - In power-down, only skip the GPIO but not the regulator calls if the flag is set Changes in v2: - Drop the change to regulator_enable logic during power-up drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c index 0060e3dcd775..db4639db9840 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c @@ -28,6 +28,7 @@ struct i2c_hid_of_goodix { struct regulator *vdd; struct regulator *vddio; struct gpio_desc *reset_gpio; + bool no_reset_during_suspend; const struct goodix_i2c_hid_timing_data *timings; }; @@ -37,6 +38,14 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_goodix, ops); int ret; + /* + * We assert reset GPIO here (instead of during power-down) to ensure + * the device will have a clean state after powering up, just like the + * normal scenarios will have. + */ + if (ihid_goodix->no_reset_during_suspend) + gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); + ret = regulator_enable(ihid_goodix->vdd); if (ret) return ret; @@ -60,7 +69,9 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops) struct i2c_hid_of_goodix *ihid_goodix = container_of(ops, struct i2c_hid_of_goodix, ops); - gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); + if (!ihid_goodix->no_reset_during_suspend) + gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); + regulator_disable(ihid_goodix->vddio); regulator_disable(ihid_goodix->vdd); } @@ -91,6 +102,9 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client) if (IS_ERR(ihid_goodix->vddio)) return PTR_ERR(ihid_goodix->vddio); + ihid_goodix->no_reset_during_suspend = + of_property_read_bool(client->dev.of_node, "goodix,no-reset-during-suspend"); + ihid_goodix->timings = device_get_match_data(&client->dev); return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0);