* [PATCH v2 1/2] gpio: tc358762: fix reset gpio handling
2026-11-25 11:37 [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling Andreas Kemnade
@ 2026-11-25 11:37 ` Andreas Kemnade
2026-11-25 11:37 ` [PATCH v2 2/2] ARM: dts: st: stm32mp15xx-dhsom: fix bridge reset polarity Andreas Kemnade
2026-11-26 16:31 ` [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling Luca Ceresoli
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-11-25 11:37 UTC (permalink / raw)
To: Neil Armstrong, Dmitry Baryshkov, Robert Foss, Laurent Pinchart,
Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Christoph Niedermaier,
Marek Vasut, Maxime Coquelin, Alexandre Torgue, Tomi Valkeinen,
Linus Walleij, Bartosz Golaszewski
Cc: dri-devel, devicetree, kernel, linux-stm32, linux-arm-kernel,
linux-gpio, Andreas Kemnade
Reset gpio is asserted when the chip should be active, deasserted when
the chip is enabled. That is the wrong way. Apparently users are working
around this by using GPIO_ACTIVE_HIGH to compensate for that bug but that
is not correcly describing the hardware.
Since this chip is used in a RPi Touchscreen hat, apparently with
devicetree overlays floating around, add a gpio quirk.
Also prepare for using the reset-gpio driver.
Fixes: 3355f4ee561d ("drm/bridge: tc358762: Add reset GPIO support")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/gpio/gpiolib-of.c | 7 +++++++
drivers/gpu/drm/bridge/tc358762.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 8f8454d596046..6519be933db8d 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -241,6 +241,13 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
*/
{ "ti,tsc2005", "reset-gpios", false },
#endif
+#if IS_ENABLED(CONFIG_DRM_TOSHIBA_TC358762)
+ /*
+ * reset is active low, but RPi touchscreen overlays
+ * specify this as active high
+ */
+ {"toshiba,tc358762", "reset-gpios", false },
+#endif
#if IS_ENABLED(CONFIG_SND_SOC_WSA881X)
/*
* WSA881 powerdown is always active low, but some device trees
diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
index 76564d5e4f69f..63b02693c0b9b 100644
--- a/drivers/gpu/drm/bridge/tc358762.c
+++ b/drivers/gpu/drm/bridge/tc358762.c
@@ -164,7 +164,7 @@ static void tc358762_post_disable(struct drm_bridge *bridge,
ctx->pre_enabled = false;
if (ctx->reset_gpio)
- gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
ret = regulator_disable(ctx->regulator);
if (ret < 0)
@@ -182,7 +182,7 @@ static void tc358762_pre_enable(struct drm_bridge *bridge,
dev_err(ctx->dev, "error enabling regulators (%d)\n", ret);
if (ctx->reset_gpio) {
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(5000, 10000);
}
@@ -242,7 +242,7 @@ static int tc358762_parse_dt(struct tc358762 *ctx)
ctx->panel_bridge = panel_bridge;
/* Reset GPIO is optional */
- ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+ ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio))
return PTR_ERR(ctx->reset_gpio);
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v2 2/2] ARM: dts: st: stm32mp15xx-dhsom: fix bridge reset polarity
2026-11-25 11:37 [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling Andreas Kemnade
2026-11-25 11:37 ` [PATCH v2 1/2] gpio: tc358762: fix reset gpio handling Andreas Kemnade
@ 2026-11-25 11:37 ` Andreas Kemnade
2026-11-26 16:31 ` [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling Luca Ceresoli
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-11-25 11:37 UTC (permalink / raw)
To: Neil Armstrong, Dmitry Baryshkov, Robert Foss, Laurent Pinchart,
Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Christoph Niedermaier,
Marek Vasut, Maxime Coquelin, Alexandre Torgue, Tomi Valkeinen,
Linus Walleij, Bartosz Golaszewski
Cc: dri-devel, devicetree, kernel, linux-stm32, linux-arm-kernel,
linux-gpio, Andreas Kemnade
Reset is active low. It is apparently set to active high to work around
a driver bug but not to indicate an additional inverter in the signal
path. Correcly describe the hardware.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/boot/dts/st/stm32mp15xx-dhsom-overlay-panel-dsi-rpi7inch.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhsom-overlay-panel-dsi-rpi7inch.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhsom-overlay-panel-dsi-rpi7inch.dtsi
index 518c269a1dba1..6342a6e757c12 100644
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhsom-overlay-panel-dsi-rpi7inch.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhsom-overlay-panel-dsi-rpi7inch.dtsi
@@ -35,7 +35,7 @@ &dsi {
bridge@0 {
compatible = "toshiba,tc358762";
reg = <0>;
- reset-gpios = <&attiny 0 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&attiny 0 GPIO_ACTIVE_LOW>;
vddc-supply = <&attiny>;
status = "okay";
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling
2026-11-25 11:37 [PATCH v2 0/2] drm/bridge: tc358762: fix reset handling Andreas Kemnade
2026-11-25 11:37 ` [PATCH v2 1/2] gpio: tc358762: fix reset gpio handling Andreas Kemnade
2026-11-25 11:37 ` [PATCH v2 2/2] ARM: dts: st: stm32mp15xx-dhsom: fix bridge reset polarity Andreas Kemnade
@ 2026-11-26 16:31 ` Luca Ceresoli
2 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2026-11-26 16:31 UTC (permalink / raw)
To: Andreas Kemnade, Neil Armstrong, Dmitry Baryshkov, Robert Foss,
Laurent Pinchart, Jernej Skrabec, Luca Ceresoli,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Christoph Niedermaier, Marek Vasut, Maxime Coquelin,
Alexandre Torgue, Tomi Valkeinen, Linus Walleij,
Bartosz Golaszewski
Cc: dri-devel, devicetree, kernel, linux-stm32, linux-arm-kernel,
linux-gpio
Hello Andreas,
On Wed Nov 25, 2026 at 12:37 PM CET, Andreas Kemnade wrote:
> The bridge driver desserts reset after disable and asserts that
> upon enbale. That requires users to workaround that by declaring
> the reset gpio wrongfully active high.
>
> Fix polarity in the one device tree actually declaring
> a reset line. That patch has to go in after the bridge fix.
>
> The issue came to sight during experiments with reset lines on the
> Epson Moverio BT-200. There are two of these chips with a shared reset
> line, so also prepare for future conversion to use a reset controller.
>
> To avoid having GPIO maintainers spammed with a bunch of patches for
> BT200 support, do that fix separately and now, so it can go in more
> fast-track way.
>
> The devicetree change is only compile tested and is more
> a cleanup, not an urgent fix.
Can you test it and report back? I guess it just means applyint patch 2
without patch 1 and checking whether it works.
Other than that the patches look OK.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread