From patchwork Mon Nov 21 17:17:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 2018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1725725wrr; Mon, 21 Nov 2022 09:26:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7HlcahrokFs/7xLdjn/MBCNAo/73n5cwD78aViMFhdX3RpuNZu0D49wdXpWIlyANfFg7Ol X-Received: by 2002:a63:ef50:0:b0:476:e813:1ae9 with SMTP id c16-20020a63ef50000000b00476e8131ae9mr3728786pgk.305.1669051611682; Mon, 21 Nov 2022 09:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669051611; cv=none; d=google.com; s=arc-20160816; b=bw5gvzUc/50D/HzHDD8pDLbDdMPDss1wREJH2dcFA1KKt1+OqRSQv9ezrG72YxRiJJ Dm3Z02XTihm5hCyXv1tcdGY47BJCzO09Y6HfPW7B2SyOt/qzK8abV4chtx9xU6OyuSsQ 6cFu/AgSRODpiatASidONz3+gv8fJl+Uzav5o6dcM7qlp6m4LPCY0xngJHfgBEVajKds M+GWxiv1xD5dUwJt/nVcyZpWlVdFiJ8YzBTxdJAJ6gbl8hfBNBAwhYRMjVC/s00Rit7l hnFroCmpHulEdXfNjTUFm9uLP1BAyDnHIW4uxQz87rWeFdFr0giQehM2RqH6+3Zx9K9i +EfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ImNw/gGC/aOKgdhkC7XvBTrRpPOBNMbGgjOp7BQrPBc=; b=X55uAww9u33vlRKNzGOwHdnniCakgKgOaTFMJBrPp2WYr12If5QcAVy12tb1+j0CzF wt+MShZrLBIiNt18hyegGHXh4+pPsOUQNtzXcK6E5t08X288Px5Dm1x05SSBPd0b9TNM v7Y7qyN7QZU8/Ju6zGra64gDdHjemZyyahn4077bGOjzy2rDnR8Nph9ezSmvdJC/MQgP jYipr0IFggAc/I4VWsAmGRnxdkWs/zd/YnewngN1onVWnTMqMz+TJ9Tba0vDu1QLlVZ+ ykkARINuLQvOi4PduEWE6Qu+LOUXCMEpcbJfXgjwRayiQ0O9M5V9VZnuf8Zj4yTxxRNx Pe1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a631b0c000000b0046ff400d209si11525461pgb.724.2022.11.21.09.26.37; Mon, 21 Nov 2022 09:26:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbiKURT1 (ORCPT + 99 others); Mon, 21 Nov 2022 12:19:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbiKURTJ (ORCPT ); Mon, 21 Nov 2022 12:19:09 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B5A11A10; Mon, 21 Nov 2022 09:17:44 -0800 (PST) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id AE28E6000D; Mon, 21 Nov 2022 17:17:34 +0000 (UTC) From: Quentin Schulz To: Shawn Guo , Krzysztof Kozlowski , Heiko Stuebner , Samuel Holland , Bjorn Andersson , Konrad Dybcio , Fabio Estevam , Jernej Skrabec , Bastien Nocera , Chen-Yu Tsai , Sascha Hauer , Pengutronix Kernel Team , Hans de Goede , Andy Gross , Rob Herring , NXP Linux Team , Dmitry Torokhov Cc: Quentin Schulz , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org Subject: [PATCH RFC v2 0/7] fix reset line polarity for Goodix touchscreen controllers Date: Mon, 21 Nov 2022 18:17:17 +0100 Message-Id: <20221103-upstream-goodix-reset-v2-0-2c38fb03a300@theobroma-systems.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750127463130175856?= X-GMAIL-MSGID: =?utf-8?q?1750127463130175856?= From: Quentin Schulz The Goodix touchscreen controller has a reset line active low. It happens to also be used to configure its i2c address at runtime. If the reset line is incorrectly asserted, the address will be wrongly configured. This cost me a few hours, trying to figure out why the touchscreen wouldn't work. The driver is "asserting" this reset GPIO by setting its output to 0, probably to reflect the physical state of the line. However, this relies on the fact that the Device Tree node setting the reset line polarity to active high, which is incorrect since the reset is active low in hardware. To fix this inconsistency, the polarity is inverted to not confuse the user about the reset line polarity. This is marked as RFC because it breaks DT compatibility and I cannot test ACPI support. Do we also make this patch series only one patchset since the DT patches depend on the driver patch and vice-versa? In which tree would this go? I'm all ears if there's a better way to handle this. We could document this in the DT binding but this kinda breaks the promise we make that the DT is not bound to the driver implementation. Thanks, Quentin To: Bastien Nocera To: Hans de Goede To: Dmitry Torokhov To: Rob Herring To: Krzysztof Kozlowski To: Shawn Guo To: Sascha Hauer To: Pengutronix Kernel Team To: Fabio Estevam To: NXP Linux Team To: Chen-Yu Tsai To: Jernej Skrabec To: Samuel Holland To: Andy Gross To: Bjorn Andersson To: Konrad Dybcio To: Heiko Stuebner Cc: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@lists.linux.dev Cc: linux-arm-msm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Quentin Schulz Signed-off-by: Quentin Schulz Signed-off-by: Quentin Schulz --- Changes in v2: - implemented ACPI support as suggested by Hans, - removed Qcom SC7180 Trogdor-based devices changes as they are not using this Goodix driver, - added comment on how to read gpiod_request_output and the GPIO DT polarity, - Link to v1: https://lore.kernel.org/r/20221103-upstream-goodix-reset-v1-0-87b49ae589f1@theobroma-systems.com --- Quentin Schulz (7): Input: goodix - fix reset polarity ARM: dts: imx: fix touchscreen reset GPIO polarity ARM: dts: sunxi: fix touchscreen reset GPIO polarity arm64: dts: allwinner: fix touchscreen reset GPIO polarity arm64: dts: imx: fix touchscreen reset GPIO polarity arm64: dts: qcom: fix touchscreen reset GPIO polarity arm64: dts: rockchip: fix touchscreen reset GPIO polarity arch/arm/boot/dts/imx6q-kp.dtsi | 2 +- arch/arm/boot/dts/imx6ul-kontron-bl-43.dts | 2 +- arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts | 2 +- .../dts/allwinner/sun50i-a64-amarula-relic.dts | 2 +- .../allwinner/sun50i-a64-oceanic-5205-5inmfd.dts | 2 +- .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 2 +- .../boot/dts/allwinner/sun50i-a64-pinetab.dts | 2 +- arch/arm64/boot/dts/freescale/imx8mm-prt8mm.dts | 2 +- .../boot/dts/freescale/imx8mq-librem5-devkit.dts | 2 +- arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dts | 2 +- arch/arm64/boot/dts/rockchip/px30-evb.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi | 2 +- arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts | 2 +- drivers/input/touchscreen/goodix.c | 45 +++++++++++++++++----- 14 files changed, 48 insertions(+), 23 deletions(-) --- base-commit: 84368d882b9688bfac77ce48d33b1e20a4e4a787 change-id: 20221103-upstream-goodix-reset-aa1c65994f57 Best regards,