lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250422-goodix-no-reset-pull-up-v1-2-3983bb65a1bf@geanix.com>
Date: Tue, 22 Apr 2025 17:15:03 +0200
From: Esben Haabendal <esben@...nix.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>, 
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Hans de Goede <hdegoede@...hat.com>
Cc: linux-input@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Esben Haabendal <esben@...nix.com>
Subject: [PATCH 2/2] Input: goodix - Allow DT specification of missing
 reset pull-up

In commit a2fd46cd3dbb ("Input: goodix - try not to touch the reset-pin on x86/ACPI devices")
a fix for problems on various x86/ACPI devices where external
pull-up is missing were added. The same type of problem can exist on
device-tree platforms, and the fix can be activated by adding the
no-reset-pull-up device-tree property.

Signed-off-by: Esben Haabendal <esben@...nix.com>
---
 drivers/input/touchscreen/goodix.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index a3e8a51c91449533b4d5185746df6b98676053dd..3a55b0f8e5132a5e1fe77bd27de74e058a4afdaf 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -775,7 +775,8 @@ int goodix_reset_no_int_sync(struct goodix_ts_data *ts)
 	 * power. Only do this in the non ACPI case since some ACPI boards
 	 * don't have a pull-up, so there the reset pin must stay active-high.
 	 */
-	if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) {
+	if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO &&
+	    ts->gpiod_rst_flags == GPIOD_IN) {
 		error = gpiod_direction_input(ts->gpiod_rst);
 		if (error)
 			goto error;
@@ -969,6 +970,13 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
 	 */
 	ts->gpiod_rst_flags = GPIOD_IN;
 
+	/*
+	 * Devices that does not have pull-up on reset signal should not be
+	 * changed to input
+	 */
+	if (device_property_read_bool(dev, "no-reset-pull-up"))
+		ts->gpiod_rst_flags = GPIOD_ASIS;
+
 	ts->avdd28 = devm_regulator_get(dev, "AVDD28");
 	if (IS_ERR(ts->avdd28))
 		return dev_err_probe(dev, PTR_ERR(ts->avdd28), "Failed to get AVDD28 regulator\n");

-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ