Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1642510lqm; Fri, 3 May 2024 01:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlMEp4PAcSBE+RUffX3c5xT0bDqMemN6KerzIKgvGSnhD5v+MY6xNLaCf3z5aUaKK7AV1MY9au060j9ATh8BsBqp1VHf/BAF2Nj+7gHQ== X-Google-Smtp-Source: AGHT+IGpLljV2p5Mt4V6ZQM5QZKXZ/drmKBQYwOpaQ/7AjVciaqWycsemlgztlNjXrVG6DQCN3vF X-Received: by 2002:a17:906:2ac5:b0:a55:6b76:eedc with SMTP id m5-20020a1709062ac500b00a556b76eedcmr1091969eje.14.1714726076029; Fri, 03 May 2024 01:47:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714726076; cv=pass; d=google.com; s=arc-20160816; b=PlpOGmDv6z7pYzyP9ZleV6CD/Hu+tfwIi1uSDiKBnFc5a/NkqhREQ6xBAyptFHVr8e 72Gr7ZdwPN3Eh/oXkazAJVsYmS28gNbonTezcS6utVR12tXAX6Azeen1xZjfbzvKIEiL iPtpIhnqDle8n0fKemaiHYL2JbAThR4mB0gCTxiFfgKV/5bCiw0dDM/LKSqGkhJxlFmF YRFH1XbK4u/HdmrVNT6bZvW9AqsIXKd7yv3k71yg9v2kbHs9AQy1KIjG6lztqQDh7JuZ q78oos+UkUOuCJb8sZI8EhnwHi0RDP3GXsIEK04V+YA2J+tZTFQDHae2O5WRk1gw91Pu 3DHA== 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=s7BpAEQh8O5SZ+jegp1YTATVOmoPzpqxpT8zLxCQSLo=; fh=3URlIhaOpsn3FhWO/hUXCPWzbnHaA4frsrvBvppYkPQ=; b=HgkWnEcYKbOt1V8T/BAXMm0roRJxaTJCFyEn3VbnmxB09G2O04/LSzMsS75+ZzP6uI hrzLmWQIB6YoL48os/U96MdAOQMRgWZhcNVl/DSXdxHi3RlalTrU/m6+F/oQPSMetx4J O21zHoxWZOlnEgafXNVaN5yXZsV/6ALEuDxdZ7NcPhjZ/9d6MOarDzkrzQJybVVf8xFr LVhSyOKf3PKbqDx+UjXf1fjeMG/xRKFZ7ya9DDGMZrKzLkLNKRkHvwqIa+e9GMCBYo/0 a1z8u6qY6gDIk6bJWDlZ8C4Qqn/Xa/FTO1CSk1ZXRDElxi1c/PF5mIOyWWSLWBPythqE Vpuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ip/ZiwKh"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k18-20020a1709062a5200b00a51802f94dcsi1363872eje.812.2024.05.03.01.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 01:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ip/ZiwKh"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167411-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167411-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C029B1F2163B for ; Fri, 3 May 2024 08:47:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E61514D2BC; Fri, 3 May 2024 08:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ip/ZiwKh" 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 4586E14A097; Fri, 3 May 2024 08:47:44 +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=1714726065; cv=none; b=N5jgty+mNjeUvJq1vhWZ5ZSWR9nebFKROTfeUMSw7SzmZzZlblWL5jmV8vdCOx5OZUKkmC5XwQZpOvp2xMpQCr5hhXsUeryvie7SIedarPlCHlW9cuIuEKh72ALu5cASsfL9y76N6w/gGf3HYym88nah5DssjJZZIhcmOC03yGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714726065; c=relaxed/simple; bh=A2/ehrj8UnAnTNHhbcvlCxq/D5HtiADTdCZbBYLQsgM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ifXK3PfPDDe+kKGaWvGfJB71KU7Zzk5+sKroNAcIDmJ5AefL8vbOUFgjVigtcGhJ5iJAMFgojHz6y+/RLtBnTEtt6aKgcHSWakZIq4ZAOul1WQ8gyBUnx/EirgjZLXjjF3L/W3JYxlePNzZgq3EHwFFXWtwXqT+UHV0yL3biU0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ip/ZiwKh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADEE4C116B1; Fri, 3 May 2024 08:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714726064; bh=A2/ehrj8UnAnTNHhbcvlCxq/D5HtiADTdCZbBYLQsgM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ip/ZiwKhJ6wXvXlo0UOeeiCuXrUSRp6xsDaa6aHWSvseLuwBF/xIJjdTACNZSEhv7 SHg8OUk0nWy58is+iuh8p5n7I76iZQtWq1QpnPPqijEGIpqxmJzvQ1Fnzm66ocKPTG IanqU1ZbV4ufF+LAAj5LCn/C2kJx4cXVqrlvpc1wTG1DqFL1rJid6DyRl0zfP9PdxV vXZHmToHlwLMWgsZXMx2xKdqhGrzyslX3MImeIU9ZR6dnip8MYun/i+eRfD/73otQm d1IL9YK2tVuiYnKTFbh/vXyl3cVDWYllWL6lY90DpQy9+PZ2UlSW07lEZWxxq8avqP Fvb1rjxu6obUA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s2oa0-000000004pD-3b9A; Fri, 03 May 2024 10:47:45 +0200 Date: Fri, 3 May 2024 10:47:44 +0200 From: Johan Hovold To: Linus Walleij Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] dt-bindings: HID: i2c-hid: elan: add 'no-reset-on-power-off' property Message-ID: References: <20240423134611.31979-1-johan+linaro@kernel.org> <20240423134611.31979-4-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 Fri, May 03, 2024 at 09:40:43AM +0200, Linus Walleij wrote: > On Tue, Apr 23, 2024 at 3:46 PM Johan Hovold wrote: > > > When the power supply is shared with other peripherals the reset line > > can be wired in such a way that it can remain deasserted regardless of > > whether the supply is on or not. > > > > This is important as it can be used to avoid holding the controller in > > reset for extended periods of time when it remains powered, something > > which can lead to increased power consumption. Leaving reset deasserted > > also avoids leaking current through the reset circuitry pull-up > > resistors. > > So the reset line in this case is a GPIO as seen from the context above. > > To me that means that the line should have the GPIO_OPEN_DRAIN flag > set in the device tree node for reset-gpios. As it has pull-up resistors, > setting the line to high impedance takes the device out of reset, and > thus it is effectively open drain. If you look at the devicetree patch later in the series this is exactly what is done. > > Add a new 'no-reset-on-power-off' devicetree property which can be used > > by the OS to determine when reset needs to be asserted on power down. > > If the above holds true, the driver can then just check for the open drain flag > in the reset-gpios phandle, and if that is set, conclude that it should not > actively drive the line low in the poweroff state. That is an alternative I considered but rejected as just knowing that the gpio is open-drain is not necessarily sufficient, for example, if the reset line is pulled to always-on rail while power to the device can be cut. Perhaps no one would ever construct hardware like that, but it does not seem like the hardware property I'm trying to encode necessarily follows from having an open-drain reset line. And then the OS should probably not make assumptions like that either, especially since getting it wrong can potentially lead to damaged hardware. Johan