[RFC PATCH v3 1/3] drm/mipi-dbi: Provide option to invert reset GPIO logic

From: Archit Anant

Date: Sat Feb 21 2026 - 02:14:29 EST


From: Chen-Yu Tsai <wens@xxxxxxxxxx>

When mipi_dbi (tinydrm) was added, the reset handling assumed that
"logic high" or "active" was out of reset, while "logic low" or
"inactive" was in reset. This is the opposite of how many reset
bindings are written, wherein "active" means the reset is active, i.e
the device is put or held in reset.

Provide an option to invert the logic so that drivers for bindings with
"active is in reset" using mipi_dbi can use the common reset handling.

Signed-off-by: Chen-Yu Tsai <wens@xxxxxxxxxx>
---
drivers/gpu/drm/drm_mipi_dbi.c | 4 ++--
include/drm/drm_mipi_dbi.h | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index 00482227a9cd..7fa1f73a38a4 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -713,9 +713,9 @@ void mipi_dbi_hw_reset(struct mipi_dbi *dbi)
if (!dbi->reset)
return;

- gpiod_set_value_cansleep(dbi->reset, 0);
+ gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 1 : 0);
usleep_range(20, 1000);
- gpiod_set_value_cansleep(dbi->reset, 1);
+ gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 0 : 1);
msleep(120);
}
EXPORT_SYMBOL(mipi_dbi_hw_reset);
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
index f45f9612c0bc..6cebf74bcecc 100644
--- a/include/drm/drm_mipi_dbi.h
+++ b/include/drm/drm_mipi_dbi.h
@@ -44,6 +44,15 @@ struct mipi_dbi {
*/
bool swap_bytes;

+ /**
+ * @invert_reset: Invert reset logic level.
+ *
+ * This is needed as drm_mipi_dbi (formerly tinydrm) introduced reset
+ * GPIO controls with "logic high" being "out of reset", while other
+ * bindings typically have "logic high" as "in reset".
+ */
+ bool invert_reset;
+
/**
* @reset: Optional reset gpio
*/
--
2.39.5