[RFC PATCH 8/8] drm/panel: synaptics-r63353: Support hw state readout

From: Dario Binacchi

Date: Sun Nov 22 2026 - 10:31:24 EST


Take over a panel left enabled by the bootloader without turning it
off. The reset line is no longer asserted at probe, since that would
turn the panel off, but when the panel is powered on.

Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx>

---

.../gpu/drm/panel/panel-synaptics-r63353.c | 33 ++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-synaptics-r63353.c b/drivers/gpu/drm/panel/panel-synaptics-r63353.c
index 73447d7b15d3..e1d84eca62c8 100644
--- a/drivers/gpu/drm/panel/panel-synaptics-r63353.c
+++ b/drivers/gpu/drm/panel/panel-synaptics-r63353.c
@@ -72,6 +72,13 @@ static int r63353_panel_power_on(struct r63353_panel *rpanel)
struct device *dev = &dsi->dev;
int ret;

+ /* The bootloader may have left the panel out of reset */
+ ret = gpiod_direction_output(rpanel->reset_gpio, 0);
+ if (ret) {
+ dev_err(dev, "Failed to assert RESET GPIO (%d)\n", ret);
+ return ret;
+ }
+
ret = regulator_enable(rpanel->avdd);
if (ret) {
dev_err(dev, "Failed to enable avdd regulator (%d)\n", ret);
@@ -181,6 +188,28 @@ static int r63353_panel_unprepare(struct drm_panel *panel)
return 0;
}

+static int r63353_panel_sro_install(struct drm_panel *panel)
+{
+ struct r63353_panel *rpanel = to_r63353_panel(panel);
+ int ret;
+
+ /* A panel held in reset can't be displaying anything */
+ if (!gpiod_get_value_cansleep(rpanel->reset_gpio))
+ return -ENODEV;
+
+ ret = regulator_enable(rpanel->avdd);
+ if (ret)
+ return ret;
+
+ ret = regulator_enable(rpanel->dvdd);
+ if (ret) {
+ regulator_disable(rpanel->avdd);
+ return ret;
+ }
+
+ return 0;
+}
+
static const struct drm_display_mode sharp_ls068b3sx02_timing = {
.clock = 70000,
.hdisplay = 640,
@@ -221,6 +250,7 @@ static const struct drm_panel_funcs r63353_panel_funcs = {
.prepare = r63353_panel_prepare,
.unprepare = r63353_panel_unprepare,
.get_modes = r63353_panel_get_modes,
+ .sro_install = r63353_panel_sro_install,
};

static int r63353_panel_probe(struct mipi_dsi_device *dsi)
@@ -254,7 +284,8 @@ static int r63353_panel_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(panel->avdd))
return PTR_ERR(panel->avdd);

- panel->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ /* The line is driven when the panel is powered on */
+ panel->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_ASIS);
if (IS_ERR(panel->reset_gpio)) {
dev_err(dev, "failed to get RESET GPIO\n");
return PTR_ERR(panel->reset_gpio);
--
2.43.0