All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/7] fix reset line polarity for Goodix touchscreen controllers
@ 2022-11-21 17:17 ` Quentin Schulz
  0 siblings, 0 replies; 44+ messages in thread
From: Quentin Schulz @ 2022-11-21 17:17 UTC (permalink / raw)
  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, linux-rockchip, linux-arm-msm,
	linux-input, linux-arm-kernel, linux-sunxi, devicetree

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

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 <hadess@hadess.net>
To: Hans de Goede <hdegoede@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Rob Herring <robh+dt@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
To: Shawn Guo <shawnguo@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
To: Pengutronix Kernel Team <kernel@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
To: NXP Linux Team <linux-imx@nxp.com>
To: Chen-Yu Tsai <wens@csie.org>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Samuel Holland <samuel@sholland.org>
To: Andy Gross <agross@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konrad.dybcio@somainline.org>
To: Heiko Stuebner <heiko@sntech.de>
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 <quentin.schulz@theobroma-systems.com>
---
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,
-- 
Quentin Schulz <quentin.schulz@theobroma-systems.com>

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2022-11-23  8:08 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 17:17 [PATCH RFC v2 0/7] fix reset line polarity for Goodix touchscreen controllers Quentin Schulz
2022-11-21 17:17 ` Quentin Schulz
2022-11-21 17:17 ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 1/7] Input: goodix - fix reset polarity Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 2/7] ARM: dts: imx: fix touchscreen reset GPIO polarity Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 3/7] ARM: dts: sunxi: " Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 4/7] arm64: dts: allwinner: " Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 5/7] arm64: dts: imx: " Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 18:18   ` Fabio Estevam
2022-11-21 18:18     ` Fabio Estevam
2022-11-21 18:18     ` Fabio Estevam
2022-11-22  7:18     ` David Jander
2022-11-22  7:18       ` David Jander
2022-11-22  7:18       ` David Jander
2022-11-22  9:58       ` Quentin Schulz
2022-11-22  9:58         ` Quentin Schulz
2022-11-22  9:58         ` Quentin Schulz
2022-11-22 12:46         ` Robin Murphy
2022-11-22 12:46           ` Robin Murphy
2022-11-22 12:46           ` Robin Murphy
2022-11-22 16:22           ` Quentin Schulz
2022-11-22 16:22             ` Quentin Schulz
2022-11-22 16:22             ` Quentin Schulz
2022-11-23  8:07             ` David Jander
2022-11-23  8:07               ` David Jander
2022-11-23  8:07               ` David Jander
2022-11-21 17:17 ` [PATCH RFC v2 6/7] arm64: dts: qcom: " Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17 ` [PATCH RFC v2 7/7] arm64: dts: rockchip: " Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz
2022-11-21 17:17   ` Quentin Schulz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.