Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2396899lqo; Mon, 20 May 2024 04:52:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuecQ5y/gm6bY0nJuSLPzHW/0tsKtgX9/dXBEU/6a2MzJ2A+axOf3OtYUiFIezIgBGP2/CY1sTlQMZBtJu0V8BhTxX6+arzQHH7d6Fuw== X-Google-Smtp-Source: AGHT+IFgV6BKthkjrxy4AOpIsWybQjVrRiLHB6WW6TPP1RV71KMcyp1x5XTA6VTjkgdyoSa1MQ/e X-Received: by 2002:a17:90a:348d:b0:2b4:32ae:4712 with SMTP id 98e67ed59e1d1-2b6cc141d7emr27607981a91.9.1716205967407; Mon, 20 May 2024 04:52:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716205967; cv=pass; d=google.com; s=arc-20160816; b=MmDjpJSfR6diIvwVT9OdTf7sH9PSH7m3whsVmAMJBQzIQyWl+bTTh/AGOxDd6LhGSe BCy2Ib4PxktXs75OKI6I/VFMExu7gsMEf/JzIdZ02Z+5LRHVRYsvuCun4F5aTNF40PqS 8jD3EFBokJWaFX8Bw8d/mDIQLG34G1yMXMmQmx0ZPMIEYtfi3M4kI/EZ5Gvhlc9wyZvP /TwRGtKclUYgWoARBLDMAgSyUrBvsBBTw3fB+2r100N2Jov8mcr2Ji/q/7zaRRSwyAPU fiwoacj7lc8T2wTA1htoSFa9oI5gWlRmPrh3aUfsbSp7MWQHtSRBbL9TxKr0vBIlWhfc pG7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AVlvsk74GFgdse8PEgbvgc8hYRN21avLSWl7pJfMbVA=; fh=gm1UZYh7W9K2T8s/K5d38/pBSAt/tm9l1453yLPretA=; b=tja1KGmXcNXwjpd6funVrlfXWBFXy+Qq+cKQfPneq2av7JF87GfLdduABEBt7XWFh8 OwnG+vZk9aF8zC/kbYZviJS7SufXSAE8Mec5hhsIZs2lC43l6NYgWTEWxEC06ZyBeaLq AdwcUEuSyEvbiyxhRmb2Eqe1f38j6Oh05UiZrufrOPqCefGcAHReENycv7BPykc4tGcC LyXIV2TJ1dcrhW1bODwF5Z4m8Y7408hUxCLa6ijw0uw8Ht2LKPc11cr1asNQ+uhJLPZc Q//D/JffTbo2V2xi6smXfbCrwXzqeu5y4eGGqQeCmSgVXWRxHhdAfHLeKGXaMnRK88kL y/Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LvG7xouh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183693-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183693-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670f4e12bsi22014894a91.65.2024.05.20.04.52.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 04:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183693-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LvG7xouh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183693-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183693-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0FB2F280AC1 for ; Mon, 20 May 2024 11:52:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BC4453E13; Mon, 20 May 2024 11:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LvG7xouh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F3EA14292; Mon, 20 May 2024 11:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716205957; cv=none; b=VmpUX4vMdmOThECkQiaPd46S05rNIQKSY0Ez/ZfVYiFLPc3jkgTQG6kUuLs+zmuuomp7AVB1L6FeIP4CFUDkdwdHmgILpWVuIiWm0lNMBM5cKORmssvgcMedjs3MeALe6+qXsM2w3wEwYY/O7I4s6H3FTovUZNaVXBiQGHDmqeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716205957; c=relaxed/simple; bh=z3aFHh38mRkuskXCICZ7ozAmniYihzx6T8rWtzfwYSQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WnbIXspQTLa+F5pf9ZiDEtA/Tt8d/1Hzev/Pc3tuuvqOvBiBCVIolpMNJ2tYhCxeZUDf6oPK7+ZmEZc4L5j+lKBg6/I4uVPpm2uH0CsD3uOoujRcKPyA6QuKkeF3NueCPpnBd+T+15xpWe1HEey1Cg54I0uivGu/fi9/ke8erow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LvG7xouh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED2B6C2BD10; Mon, 20 May 2024 11:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716205957; bh=z3aFHh38mRkuskXCICZ7ozAmniYihzx6T8rWtzfwYSQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LvG7xouhQzrqPROcXkFFVpuc4pXu3XX+WUuWvOH/btvB2pZHPKjNmkMnDeGO9l7mj quyi5oA5fu6YJ9kl5lF8dYQjMwLsURXf8UxtRjY7VmZKlpQpwy9qLkoNQ2bjzWCPE/ 1qBqEp43fgPJUrn2xcdJ066r8D5dny3DjyQo+LT88Q1mXEil3wpyTA4dD70D3TkNJc ep8NRmTkB/V5yJehV1U6wTWqCHsdbC/Hv1JPueFz2vRhj4uq/ZipVDDkDwxFrGH+gp dHLe1UmBEims3QkdMIfPFQB80bx+BFp7J3BmpipHZJ+fKoZp07gF08lSAJvLxA6BOc szFa9EhP+fZAw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s91ZA-000000004K1-07cL; Mon, 20 May 2024 13:52:32 +0200 Date: Mon, 20 May 2024 13:52:32 +0200 From: Johan Hovold To: Doug Anderson 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 Subject: Re: [PATCH v2 4/7] HID: i2c-hid: elan: fix reset suspend current leakage Message-ID: References: <20240507144821.12275-1-johan+linaro@kernel.org> <20240507144821.12275-5-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 AM Johan Hovold wrote: > > > @@ -67,7 +77,14 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops) > > > struct i2c_hid_of_elan *ihid_elan = > > > 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 remain > > > + * 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_delay_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. Johan