Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2533957lqo; Mon, 20 May 2024 08:38:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiwulx2RWgrmkllz5D6Ri8WDd6NBYIwjScXy33WUVc1wUO0Bu7/RiLopsH1K8ohMkRjApOIIR7trfbB2cdFnd9zS4EJonMmcjRmT8Kwg== X-Google-Smtp-Source: AGHT+IGgPL/E5WPvUMvyUJR7N8E+xnHUAdu0ehTaNQ2WRxwSNOjmEUZvEMIEbD4o5GeljrBDDZXH X-Received: by 2002:a17:902:d509:b0:1f2:f8f5:db1c with SMTP id d9443c01a7336-1f2f8f5de0dmr81351925ad.7.1716219539518; Mon, 20 May 2024 08:38:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716219539; cv=pass; d=google.com; s=arc-20160816; b=xXGLJvMoYXekwJ51aHmx26Hd5KxAQogcmGdGdyECgpOeFEqZoryR4k6vAT4QRUBVdu 0hSVFTLnPKsxbP3Ub5nNBmaHVqoFyKWUuTzUcDaN0q9K4gehV3vff90m0SIx3AQuC3aU RdneBDpElZaT0WJRMIFWFSgQj7EIKS0pgM71TbpaSYv9n2R1TbPjOeqV0suTKW2HY2lW pXLTytYj2vE1jUatZWGetmI3cUEoZZrxpKgUoQ/nnbuvTyJFs4Rq2XfVnJ6dn6UkcD6d yQeE0WtI9/MroGqZbL6OKSSFaQzW2V0bE+I0SuEQHjU7gQwjnxct2u0JJ/X3ynDy34b3 8fYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=OKPnejpOVVglMsc+d8kH/kXQPdEfmoXhhEf4Gy8y/h4=; fh=11jOOiX5JGXnTwAPGiYt94jMc0B2ez8rfcT7VUOmTaA=; b=uZHpd+lOJjJL+YOz/A2vRRdLg4EqQGFNhAZnHGCgvnOxqiC3+QtNxeJQGTzy1pJAca hdZ54wvIQP8ZEfY0EVJeudHArM9VHkPAJlUTPseLZkCpxhjB1p5kMkfzIB3+OC5TnmXy R35AxGoTx78jegYzCb7PL1pOttAoLABumOakosto2uKhTou9UOODK6hLcjgRgQu8wFt9 4oHX6Gstl9ZTCacXw+Ce5IWjsl0Cru2vkNEOwes04R0MdFgQr60t9XoQ9yKB4dGUFQeH MkzSR29ZuvGctIIyS8IkOm9jEvRDJhCz8t37TiEI8gDhHYRH0Qdz9r1pBQop+yp7AY/q eO5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jcDWKg0s; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-183914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bad63d3si26504665ad.139.2024.05.20.08.38.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 08:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jcDWKg0s; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-183914-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8CBF2B2109A for ; Mon, 20 May 2024 15:38:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13035136E0C; Mon, 20 May 2024 15:38:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jcDWKg0s" Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 940ED13774A for ; Mon, 20 May 2024 15:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716219523; cv=none; b=HYi1BhGv63J6MlEKh78R9qzS6zc7aJoP8w8iiOlA2kIoV2KPUTce8yXqdgkDiGCqpo9XEYagbX/mqUC5dWdUjnI+KbSnPyXjtiDBqQxmRnCUpPk4TdkWCJjO6DdwA0En3skL+m3FzTUNkBw++wjA5YaXFxWoCEYkogtKdUdZoN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716219523; c=relaxed/simple; bh=xR38KVD3bbKUAoYUfwjtudqWW7AHDRaw+vcgMm2ki0k=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GcPNatY1Y6uL9Ywnd94pzetMAzBOfbQ33yEuf99rW1HJHiqBEMBvk5rtfaqPpkB6HUN44sKYT3M/y5MNz4LDq0f+3ECt0pDzdCJAvJg+ETfagd+wwsY2piX2tx3jES1MnVeiPEkbmFc1JyLiwUx0tDs1D9Vtu+Hz2EnQxv3FDDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jcDWKg0s; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-792b8d98a56so263191185a.2 for ; Mon, 20 May 2024 08:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716219519; x=1716824319; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OKPnejpOVVglMsc+d8kH/kXQPdEfmoXhhEf4Gy8y/h4=; b=jcDWKg0sCj9Z1di9jCbTIx5rkSsbT3LhrbMyn7yENFnTPNcxNyDJ0zf0d2CHFf34JT i576qs6AC94WVfmFFMgIVz3ZdnOGZ9GHmN92EktC2txstqXDkWTSK6hoWeo9Ptu8yLIa ZGZL21wAbxmorqAO4T1F1IZj8Gq2/r8mQeISU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716219519; x=1716824319; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OKPnejpOVVglMsc+d8kH/kXQPdEfmoXhhEf4Gy8y/h4=; b=eXGpFBoOiqLcbopVSWA0LNwqikM//5xTzUjuRwZ6vYqBp5KSNn8mvd4iiMLT6ob1/P 1wZOAqe8qc3bU7Vwwi+wq0oE7Ewbuhnh+bF3a3KNuwdu3RxZZ1H6unajcfJltV6Dtu5K nMXlT+kzuChoknJctDBeR/n5y8wzdCkNo8xXorIEu2ZDmNEqHeNo2WpzGS4/iVKLJXiC uTFTBbgPKL7X7CdgvXZygVw5ouPqM7b/F1zK195t2hnwKj0wC5+NJIX449T4w7ioe9uD uReD4RnC5+ElBS4TIwTAj1QOWOk7mTx33S2UTcXGNDnh2dhxODFgwkv/fTGZEy+zhpwn dSXg== X-Forwarded-Encrypted: i=1; AJvYcCWetau5+J6flj1cDT6WU7gS4Cs+/SN1LJPgX7HsGbpbYZWoIuI2gByYGD9KhcRmXggQdXbMy8phaz9T79ERLg5vdUceDWkTAIL6LECY X-Gm-Message-State: AOJu0YzAFr1pzjU0BrDhph+CAz0qXGY5wJXlFqktDjkNFSi+6/vNHPxR 1uUTOLUZeAa7q8Qhp0F7FcGsg2HTbjMOaSRkKCFHjn8G3UQ9Mmpr619OtrEWQ2smWEXeeVV5ptY = X-Received: by 2002:a05:620a:4607:b0:792:95cf:99fc with SMTP id af79cd13be357-792c75f44a8mr3838576785a.62.1716219518672; Mon, 20 May 2024 08:38:38 -0700 (PDT) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf2fca82sm1191793985a.89.2024.05.20.08.38.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 May 2024 08:38:37 -0700 (PDT) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-43dfe020675so647991cf.0 for ; Mon, 20 May 2024 08:38:37 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWCJXPo3v9H9xAHRAFHQZ4ZEbbiwZtg/4jQEg9s2OluR5Hoa6l7ZFBTOdnBkAwVrYUY/kOzK3Tkqj06NK+0sfKEDTIer/AklxQoqLef X-Received: by 2002:a05:622a:5917:b0:43e:ec2:4bb8 with SMTP id d75a77b69052e-43f797e0ecemr5611191cf.26.1716219516885; Mon, 20 May 2024 08:38:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507144821.12275-1-johan+linaro@kernel.org> <20240507144821.12275-5-johan+linaro@kernel.org> In-Reply-To: From: Doug Anderson Date: Mon, 20 May 2024 08:38:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/7] HID: i2c-hid: elan: fix reset suspend current leakage To: Johan Hovold Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Linus Walleij , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Steev Klimaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Mon, May 20, 2024 at 4:52=E2=80=AFAM Johan Hovold wro= te: > > On Mon, May 20, 2024 at 01:44:06PM +0200, Johan Hovold wrote: > > On Fri, May 10, 2024 at 04:36:08PM -0700, Doug Anderson wrote: > > > On Tue, May 7, 2024 at 7:48=E2=80=AFAM Johan Hovold wrote: > > > > > @@ -67,7 +77,14 @@ static void elan_i2c_hid_power_down(struct i2chi= d_ops *ops) > > > > struct i2c_hid_of_elan *ihid_elan =3D > > > > container_of(ops, struct i2c_hid_of_elan, ops); > > > > > > > > - gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); > > > > + /* > > > > + * Do not assert reset when the hardware allows for it to r= emain > > > > + * deasserted regardless of the state of the (shared) power= supply to > > > > + * avoid wasting power when the supply is left on. > > > > + */ > > > > + if (!ihid_elan->no_reset_on_power_off) > > > > + gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); > > > > + > > > > if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms) > > > > msleep(ihid_elan->chip_data->post_gpio_reset_off_de= lay_ms); > > > > > > Shouldn't the above two lines be inside the "if > > > (!ihid_elan->no_reset_on_power_off)" test? If you're not setting the > > > reset GPIO then you don't need to do the delay, right? > > > > Yes, I guess you're right. The off-delay is weird and not normally used= , > > but apparently it is needed by some panel-follower use case. AFAICT it'= s > > not even related to the reset line, just a hack to add a delay before > > the panel is reset by some other driver (see f2f43bf15d7a ("HID: > > i2c-hid: elan: Add ili9882t timing")). > > > > I think that's why I just looked the other way and left this little > > oddity here unchanged. > > Hit send too soon. > > Since this hack does not appear to be related to the reset line, I think > it's correct to not have it depend on whether the reset line is asserted > or not (e.g. as there could be 'panel-followers' with > 'no_reset_on_power_off'): > > The datasheet specifies there should be 60ms between touch SDA > sleep and panel RESX. Doug's series[1] allows panels and > touchscreens to power on/off together, so we can add the 65 ms > delay in i2c_hid_core_suspend before panel_unprepare. > > The power-off delay variable should probably be renamed, but that's a > separate change. > > So I think v2 of this series is good to go. Sure. As I think we've seen in the past, my choice of bikeshed paint color seems to be quite different than yours, but nothing here seems like it needs to block landing, so: Reviewed-by: Douglas Anderson