Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity
       [not found] <20261126134508.320700-1-vz@kernel.org>
@ 2026-11-26 13:45 ` Vladimir Zapolskiy
  2026-11-26 13:52   ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2026-11-26 13:45 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Ritesh Kumar, Rob Herring,
	Krzysztof Kozlowski, Bjorn Andersson, Konrad Dybcio
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, Conor Dooley, devicetree, Abel Vesa,
	linux-arm-msm, linux-gpio

The RESET_N pin of NT36672E panels is an active low signal, however
the driver drives the reset GPIO with inverted logical values, thus
the reset GPIO has to be described as active high in device trees,
which contradicts the panel hardware as well as the panel-common.yaml
convention.

Fix the driver to assert the reset GPIO to put the panel into reset,
and to deassert it to release the panel from reset along with adding
a gpiolib-of quirk, which enforces the active low polarity of the
NT36672E panel reset GPIO. With the quirk the reset signal levels
remain unchanged for dtbs, which describe the reset GPIO as active
high, and device trees, which describe it as active low, start to work.

To: Linus Walleij <linusw@kernel.org>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
---
 drivers/gpio/gpiolib-of.c                      | 9 +++++++++
 drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 8 ++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 8bc4562608e1..2e14173196e9 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -248,6 +248,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
 		 * compatible.
 		 */
 		{ "sdw10217201000",	"powerdown-gpios", false },
+#endif
+#if IS_ENABLED(CONFIG_DRM_PANEL_NOVATEK_NT36672E)
+		/*
+		 * The RESET_N pin of Novatek NT36672E panels is an active low
+		 * signal, however the panel driver and the device trees used
+		 * the inverted polarity and described the reset GPIO as
+		 * active high.
+		 */
+		{ "novatek,nt36672e",	"reset-gpios",	false },
 #endif
 	};
 	unsigned int i;
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
index 85902338f10d..364e0855280f 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
@@ -372,12 +372,12 @@ static int nt36672e_power_on(struct nt36672e_panel *ctx)
 	 * Reset sequence of nt36672e panel requires the panel to be out of reset
 	 * for 10ms, followed by being held in reset for 10ms and then out again.
 	 */
-	gpiod_set_value(ctx->reset_gpio, 1);
-	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->reset_gpio, 0);
 	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->reset_gpio, 1);
 	usleep_range(10000, 20000);
+	gpiod_set_value(ctx->reset_gpio, 0);
+	usleep_range(10000, 20000);
 
 	return 0;
 }
@@ -387,7 +387,7 @@ static int nt36672e_power_off(struct nt36672e_panel *ctx)
 	struct mipi_dsi_device *dsi = ctx->dsi;
 	int ret = 0;
 
-	gpiod_set_value(ctx->reset_gpio, 0);
+	gpiod_set_value(ctx->reset_gpio, 1);
 
 	ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
 	if (ret)
@@ -544,7 +544,7 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)
 	if (ret < 0)
 		return ret;
 
-	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(ctx->reset_gpio))
 		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset-gpios\n");
 
-- 
2.51.0


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

* Re: [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity
  2026-11-26 13:45 ` [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity Vladimir Zapolskiy
@ 2026-11-26 13:52   ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-26 13:52 UTC (permalink / raw)
  To: Vladimir Zapolskiy; +Cc: dri-devel, devicetree, linux-gpio, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/panel: novatek-nt36672e: missing Fixes trailer for reset
  GPIO polarity fix
--

commit 9b3b20020b17a5e54e69c4e88df2960f428e2e60
Author: Vladimir Zapolskiy <vz@kernel.org>

> drm/panel: novatek-nt36672e: Fix the reset GPIO polarity
>
> The RESET_N pin of NT36672E panels is an active low signal, however
> the driver drives the reset GPIO with inverted logical values, thus
> the reset GPIO has to be described as active high in device trees,
> which contradicts the panel hardware as well as the panel-common.yaml
> convention.
>
> Fix the driver to assert the reset GPIO to put the panel into reset,
> and to deassert it to release the panel from reset along with adding
> a gpiolib-of quirk, which enforces the active low polarity of the
> NT36672E panel reset GPIO. With the quirk the reset signal levels
> remain unchanged for dtbs, which describe the reset GPIO as active
> high, and device trees, which describe it as active low, start to work.
>
> To: Linus Walleij <linusw@kernel.org>
> To: Bartosz Golaszewski <brgl@kernel.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>

[Severity: Low]
This fixes the inverted reset GPIO logical polarity from the initial driver
commit.  Should this include:

  Fixes: ea4f9975625a ("drm/panel: Add support for Novatek NT36672E panel driver")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126134508.320700-1-vz@kernel.org?part=3

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

end of thread, other threads:[~2026-11-26 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261126134508.320700-1-vz@kernel.org>
2026-11-26 13:45 ` [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity Vladimir Zapolskiy
2026-11-26 13:52   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox