Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp278142lqd; Wed, 24 Apr 2024 01:51:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUniPFuMdpxSYee6dqxrwHA3IARiOZglNc6kNksSFH1aX/6rkRJ4a/jHj2BsIQXpd4L7AFMNWvapXxfcxEQJjCZUZjWiu6RWJJSQi+fxw== X-Google-Smtp-Source: AGHT+IF61I/8S8iQtamdnrWnJAt9MTpqExGjcQWdLeiRwfwjS+vZdrk1/DoC+1PCxNN8V6Iv7RHa X-Received: by 2002:a17:902:d4c9:b0:1e8:4063:6dfe with SMTP id o9-20020a170902d4c900b001e840636dfemr2208564plg.10.1713948664304; Wed, 24 Apr 2024 01:51:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713948664; cv=pass; d=google.com; s=arc-20160816; b=C0R66E1hEbka/inQ/pjElGa5QfbLPOjrFMl31Mtp0j0Upvi39ckN5vnvejs/4CJ1et P057a6IgYn4NJ0dBwMC2aRmvtrmWcPq7oVXP4do5+pVN2Z5YLpaQGasOPwvGZ9qSgJez zDqED/LracoSmdJBRwpVJmlRJzByradBKZUYxgRl63p3wFz0m4LAXO5UTP9HTQQ+UQoY yp+COsSjI8WPe21/JczNKiUGHqZwLhCvvtjtiuCHyIjAY1yXiaC2gxSSjGIHP6tEmuNx kxca9uDt2ocxy+z5FMcFZAMSRgk7KFkcY/g/MLGNlBEa49NoNkBuaiYob7B8qFsBcGZd sUlQ== 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=cKHyQQ0ME4aiXIuyTFnaSt6u7qqru4ummnROchLSdQ8=; fh=kznFtThQT5ZZ7o391PbtGMg38cImiSvCP+ICMG4/8p8=; b=iew7RhmrOIg1FxDPbpedsZYxjVOYLdcfQPFNv16r438XeaKKWDhvg1I3j047/gYQ8e /C6F87pQWZc49d89UifD1Hs2OW1cc8/n9FrYBQvp4PB/IS2ruJKyQTfViKCpk324nmXH ikeouhUMH2DgmLJvBBP1TkCyJBx7Njw4Cq9aPBv2Ct2xPVUSlASfFleVze2NambyAJxH 7zKur0V7RMR+Gkb+9dYu0FvSN6q0fY9K8yupxRGDvhFtd1kmk74Awu40xBqt4SFjJ41Q yVfbUBUo7CfJPYu69AjX0y01OKVe37hRmKMokYFrbNkoIt9rmFlUfBUsBMqq1BH4ToQT vjRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B7bkm6bh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-156576-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156576-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 d17-20020a170903209100b001e528f373edsi10597237plc.602.2024.04.24.01.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 01:51:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156576-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=B7bkm6bh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-156576-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156576-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 E8907285768 for ; Wed, 24 Apr 2024 08:51:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B37E4158A24; Wed, 24 Apr 2024 08:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B7bkm6bh" 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 AEA471581EB; Wed, 24 Apr 2024 08:50:51 +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=1713948651; cv=none; b=cDl9deSNScDwn10spnRDq43DmGwRIX9xrffnk++3TBvUfhguXoAZNCI/KbIk0RAdrULdK9m8XNRW2dAh4x4j6vCCU2vPivQlZ5o63ehJqSmswaMhWEOF66vB3Aq0MbJq+p785ZuA0nOFQ4z6w/jy9rHTApBcpw5TpTOODyyzKww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713948651; c=relaxed/simple; bh=SoCDPr8M1Fw4mP+EiUCPkaLfHhVVC2cfI+W6y4qffnY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bvabJxCsBllBV2FXjmmLQBga2VZXv781KGvMdn93LC8C5q3YV02m2WMxR7ftgMYtgv692eOKNQvpCgGnksA6lmvLCgKCzkmtHSNez1HqEOi0Q8992NU5Ok1m0XB9TGQyNwJrdoo37FrKHKNJMkG7hVy4HbgU4MSr7DpaDHxdv28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B7bkm6bh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31F16C32781; Wed, 24 Apr 2024 08:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713948651; bh=SoCDPr8M1Fw4mP+EiUCPkaLfHhVVC2cfI+W6y4qffnY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B7bkm6bhC8IaAkHMDShhEZjGha+KoTqWGZ9El8Be30qGpo1JnySegNBj8FAicVDI+ 5jyQugWsInwMRMtUsW2ba1a5XJqeEC0SvVsXMSLRlJhyUP/tHG5mYPlgTI1W/a4HCw mWbv2Zf90cIs7Nd4DDQo5L9d7urNboMJrCZetwN7ejf+rfHbeafJcKI/WxQYgdTUmi JCY7FGsfVB5wYlOKrUFwiE//3El1Nwx86FLBMI5kl/NVVL29mOJM6KnXamqh7nn5sf WmkmLrlslwAAnlYuD9rmKE8eNqSpif4DtUIVzw6tJL8f4YHeM1OykfCuDWIcc0FVem 5ovZULSNc1Vkw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzYL2-000000001ZJ-3WVh; Wed, 24 Apr 2024 10:50:49 +0200 Date: Wed, 24 Apr 2024 10:50:48 +0200 From: Johan Hovold To: Doug Anderson Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/6] HID/arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Message-ID: References: <20240423134611.31979-1-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 Tue, Apr 23, 2024 at 01:36:18PM -0700, Doug Anderson wrote: > On Tue, Apr 23, 2024 at 6:46 AM Johan Hovold wrote: > > The Elan eKTH5015M touch controller on the X13s requires a 300 ms delay > > before sending commands after having deasserted reset during power on. > > > > This series switches the X13s devicetree to use the Elan specific > > binding so that the OS can determine the required power-on sequence and > > make sure that the controller is always detected during boot. [1] > > > > The Elan hid-i2c driver currently asserts reset unconditionally during > > suspend, which does not work on the X13s where the touch controller > > supply is shared with other peripherals that may remain powered. Holding > > the controller in reset can increase power consumption and also leaks > > current through the reset circuitry pull ups. > > Can you provide more details about which devices exactly it shares > power with? I'm worried that you may be shooting yourself in the foot > to avoid shooting yourself in the arm. > > Specifically, if those other peripherals that may remain powered ever > power themselves off then you'll end up back-driving the touchscreen > through the reset line, won't you? Since reset is active low then not > asserting reset drives the reset line high and, if you power it off, > it can leach power backwards through the reset line. The > "goodix,no-reset-during-suspend" property that I added earlier > specifically worked on systems where the rail was always-on so I could > guarantee that didn't happen. > > From looking at your dts patch it looks like your power _is_ on an > always-on rail so you should be OK, but it should be documented that > this only works for always-on rails. > > ..also, from your patch description it sounds as if (maybe?) you > intend to eventually let the rail power off if the trackpad isn't a > wakeup source. If you eventually plan to do that then you definitely > need something more complex here... No, that's the whole point: the hardware is designed so that the reset line can be left deasserted by the CPU also when the supply is off. The supply in this case is shared with the keyboard and touchpad, but also some other devices which are not yet fully described. As you rightly noted, the intention is to allow the supply to eventually be disabled when none of these devices are enabled as wakeup sources. I did not want to get in to too much details on exactly how this particular reset circuit is designed, but basically you have a pull up to an always-on 1.8 V rail on the CPU side, a FET level shifter, and a pull up to the supply voltage on the peripheral side. With this design, the reset line can be left deasserted by the CPU (tri-stated or driven high), but the important part is that the reset signal that goes into the controller will be pulled to 3.3 V only when the supply is left on and otherwise it will be connected to ground. > > Note that the latter also affects X13s variants where the touchscreen is > > not populated as the driver also exits probe() with reset asserted. > > I assume driving against an external pull is _probably_ not a huge > deal (should be a pretty small amount of power), but I agree it would > be nice to fix. > > I'm a bit leery of actively driving the reset pin high (deasserting > the reset) just to match the pull. It feels like in your case it would > be better to make it an input w/ no pulls. It almost feels like > something in the pinctrl system should handle this. Something where > the pin is default "input no pull" at the board level and when the > driver exits it should go back to the pinctrl default... If you look at the DT patch that's essentially what I'm doing by describing the reset pin as open-drain so that it will be configured as an input (tristated) when reset is deasserted and only driven low when reset is asserted. > I guess one last thought is: what do we do if/when someone needs the > same solution but they want multiple sources of touchscreens, assuming > we ever get the second-sourcing problem solved well. In that case the > different touchscreen drivers might have a different idea of how the > GPIO should be left when the driver exits... The second-source problem is arguable a separate one, and as we've discussed in the past, the current approach of describing both devices in the devicetree only works when the devices are truly compatible in terms of external resources (supplies, gpios, pinconfig). For anything more complex, we need a more elaborate implementation. In this case it should not be a problem, though, as the reset circuit should have the same properties regardless of which controller you connect (e.g. both nodes would have the 'no-reset-on-power-off' property). Johan