From patchwork Tue Apr 22 15:15:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 883325 Received: from mail-4327.protonmail.ch (mail-4327.protonmail.ch [185.70.43.27]) (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 EBDB528EA7D for ; Tue, 22 Apr 2025 15:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745335404; cv=none; b=Y37WCvEG5kmzkJlVZTYgDPk2J01CJ0DfuD3hTngzCUkniN2GLDGJoUO/6L7YUL0gUXx3lezUKlQgomMNJhZBgLLvdFruCPDPr3U7q419yGRmxe3x0YGUVNoKebzA4EfQd8V/LqUuPnyaTBrzdSww1/odExfSXLUlGu67MHMzZ4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745335404; c=relaxed/simple; bh=ENVcO6fJ07Q9ue66u/qiSIcncXd28QyJZIW3G5Jd6VU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+4FQe7Hm/vwrMt7cSyTmAb4vCs+LhHegEg4EQsS8B6Zex9Yuj125reTtl0dVG7V/reWN2byjL7TKdsJpH3UEm1kkWtiXb26awoAalUqOJ+DrU76hRsrKFek4oAHNE3CJiP6z95U9CIG0hzVcbNjx5openmeAsgfDfztCqMlNSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=geanix.com; spf=pass smtp.mailfrom=geanix.com; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b=cYDHm37A; arc=none smtp.client-ip=185.70.43.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=geanix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=geanix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="cYDHm37A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1745334914; x=1745594114; bh=bp+Gp0KHAB3JE9AJDw/mdtN3MLyCWZjeKfW4QBlVxh8=; h=From:Date:Subject:Message-Id:References:In-Reply-To:To:Cc:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=cYDHm37AXU7ay9QSebFJ0KhfHG0FZhAvvmCB3L11RHlqh9KEzmaYwAG582QbYrbSu G7z7wUecBnQp2h+WgEveSgvSUQ2OfJLNhMhewsMR5HslNClDzSu4tpL1cu3AfAARtG /qfjOJNB071fAIEL8K2e+HB/hfcx8liEioNLO8H5TyxxpvlsWJz5o6FaSh/dyJCh8K nrt/lZmBkBNzMVMnu6gckI7uiATFTJJafMh3hNnBOVrVe0jaxyW6Ox13+9UG6Y31C6 NRc6iFm8Uz6zuZXrr+rEZcjOuNYCda1txSHfqN8VWnAfXrqYWOsrOCukptnus5HRs7 J9F8qzryBOaQQ== From: Esben Haabendal Date: Tue, 22 Apr 2025 17:15:02 +0200 Subject: [PATCH 1/2] dt-bindings: input: touchscreen: goodix: Add no-reset-pull-up property Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250422-goodix-no-reset-pull-up-v1-1-3983bb65a1bf@geanix.com> References: <20250422-goodix-no-reset-pull-up-v1-0-3983bb65a1bf@geanix.com> In-Reply-To: <20250422-goodix-no-reset-pull-up-v1-0-3983bb65a1bf@geanix.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Esben Haabendal X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745334911; l=1026; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=ENVcO6fJ07Q9ue66u/qiSIcncXd28QyJZIW3G5Jd6VU=; b=FMIQ+pa/+Zxa3ZyfSAm0zfLEYEQTf6zqo0YFM1UXQt6Yf1bddxDeYCndGv6286smfaUMHxynI XC2Ac4jlqqZAWocPikGzEoVR+cmq/yziopysGMEbz+x4eS9CVpEFcD7 X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= This should be added for boards where there is no pull-up on the reset pin, as the driver will otherwise switch the reset signal to high-impedance to save power, which obviously not safe without pull-up. Signed-off-by: Esben Haabendal --- Documentation/devicetree/bindings/input/touchscreen/goodix.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml b/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml index eb4992f708b70fef93bd4b59b9565123f7c6ad5d..7e5c4b98f2cb1ef61798252ea5c573068a46d4aa 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.yaml @@ -45,6 +45,10 @@ properties: reset-gpios: maxItems: 1 + no-reset-pull-up: + type: boolean + description: There is no pull-up on reset pin + AVDD28-supply: description: Analog power supply regulator on AVDD28 pin From patchwork Tue Apr 22 15:15:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esben Haabendal X-Patchwork-Id: 884639 Received: from mail-244102.protonmail.ch (mail-244102.protonmail.ch [109.224.244.102]) (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 DDDA519CC3A for ; Tue, 22 Apr 2025 15:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745335321; cv=none; b=Kq88XlBCcHEKAwOxG43Do8aWVAIWaJgnXA+03QF+m4eMTNqYUnZWQ+wI6PFhwJEHpf8E4AL9wXBiNPk9X2IZYk2kx+W5IgHJQxASgNeEYoc8B4m6gOF88WWCzyLlyosTlRrxCy5A/9WuU+tjC72KQ5mr0A4zO/2dJRaF+qChE/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745335321; c=relaxed/simple; bh=XrDdZMiQCYZWtkyVR+1sBXNNGQPlKxsaHf0T2Hnlrwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mYw9/lJSJZLbzpyVO5r0QIpQeEyhj+1PcROGMJWQz/SVyE2LMxuf7J9TprcN3RllI/e1uzkZ/O9ZLW2QLN1tjoL/dYPluG1sgtop2iPnRyETEPm0Qa7AcjGhXR2Rf4DFUysKsh5UvOzJhCuGqQHCSjs3guzzCDtrSgTVqc66s6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=geanix.com; spf=pass smtp.mailfrom=geanix.com; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b=EYZ3kgqU; arc=none smtp.client-ip=109.224.244.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=geanix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=geanix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="EYZ3kgqU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1745334916; x=1745594116; bh=qinWNI4zrP64TYceXuUBsDjhYtu4GSfZQrgajmm4aQw=; h=From:Date:Subject:Message-Id:References:In-Reply-To:To:Cc:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=EYZ3kgqUpN8wRIfAfRGNEicZc/qp/G9fVH11TKXb9eaUL0YAvTdSRMG949zvZL0Ka 6ihSJi11JveIIUzPHL9Al3v+zwFBwkcrKgf/EC6lxm6pzyl2i8oqAD6/6pUsQmwv83 N/I36hFak0XM9AMpVI4DpKI3OjslQEmTTLj2cFTmqXgHqriiJBTaF5qDSvGRmYg2tf 9W0V4JskVgHFMi2oxyDEZ59gRinqnG7dHCZwg2KbWy+pylale8d1lZmUnsQ/gb5dpy peUgnAYgY0elncEAyoguqlstkf8YKTwMGBy9mIB3UXz6Flw0FvcHJozp8drD53zPK/ HkCnqnDNiwqzg== X-Pm-Submission-Id: 4Zhm4z0y89z4wx9h From: Esben Haabendal Date: Tue, 22 Apr 2025 17:15:03 +0200 Subject: [PATCH 2/2] Input: goodix - Allow DT specification of missing reset pull-up Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250422-goodix-no-reset-pull-up-v1-2-3983bb65a1bf@geanix.com> References: <20250422-goodix-no-reset-pull-up-v1-0-3983bb65a1bf@geanix.com> In-Reply-To: <20250422-goodix-no-reset-pull-up-v1-0-3983bb65a1bf@geanix.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans de Goede Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Esben Haabendal X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745334911; l=1750; i=esben@geanix.com; s=20240523; h=from:subject:message-id; bh=XrDdZMiQCYZWtkyVR+1sBXNNGQPlKxsaHf0T2Hnlrwg=; b=jRW+MrsUzdfwfOoQGvfpiB9UjYWL0lEg42ggfjTprYEFFJoNGZKSePA0VQOholEEcth9FEuNx XgRFhA0zOE/ALCVNY//VNmN+XoPjN1LEqZuJ/OnYIzHQUTeXExz8XVQ X-Developer-Key: i=esben@geanix.com; a=ed25519; pk=PbXoezm+CERhtgVeF/QAgXtEzSkDIahcWfC7RIXNdEk= 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 --- 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");