[PATCH v2 05/16] drm: renesas: rzg2l_mipi_dsi: Add support for DSI PWRRDY

From: Biju

Date: Wed Jul 29 2026 - 09:21:29 EST


From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

The register for controlling power to the DSI region is in the SYSC
(System Controller) block. Add support for controlling the DSI PWRRDY
signal so the driver can efficiently manage power to the DSI region.

Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
---
v1->v2:
* Switched to power sequence for handling pwrrdy signal.
* Dropped header file regmap.h and mfd/syscon.h
* Added header file pwrseq/consumer.h
---
.../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
index 180384c10264..7fdcee98450b 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
@@ -18,6 +18,7 @@
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/pwrseq/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/units.h>
@@ -63,6 +64,7 @@ struct rzg2l_mipi_dsi_hw_info {
unsigned long max_dclk;
u16 activation_dly;
u8 features;
+ bool pwrrdy;
};

struct rzv2h_dsi_mode_calc {
@@ -87,6 +89,8 @@ struct rzg2l_mipi_dsi {
struct clk *vclk;
struct clk *lpclk;

+ struct pwrseq_desc *pwrseq;
+
enum mipi_dsi_pixel_format format;
unsigned int num_data_lanes;
unsigned int lanes;
@@ -1396,6 +1400,36 @@ static const struct dev_pm_ops rzg2l_mipi_pm_ops = {
* Probe & Remove
*/

+static void rzg2l_mipi_dsi_pwrrdy_off(void *data)
+{
+ pwrseq_power_off(data);
+}
+
+static int rzg2l_mipi_dsi_pwrrdy_init(struct rzg2l_mipi_dsi *dsi)
+{
+ int ret;
+
+ if (!dsi->info->pwrrdy)
+ return 0;
+
+ dsi->pwrseq = devm_pwrseq_get(dsi->dev, "dsi-pwrrdy");
+ if (IS_ERR(dsi->pwrseq)) {
+ /*
+ * This platform requires a sequencer. If we can't get it, we
+ * must return the error (including -EPROBE_DEFER to wait for
+ * the provider to appear)
+ */
+ return dev_err_probe(dsi->dev, PTR_ERR(dsi->pwrseq),
+ "Failed to get required power sequencer\n");
+ }
+
+ ret = pwrseq_power_on(dsi->pwrseq);
+ if (ret)
+ return ret;
+
+ return devm_add_action_or_reset(dsi->dev, rzg2l_mipi_dsi_pwrrdy_off, dsi->pwrseq);
+}
+
static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
{
unsigned int num_data_lanes;
@@ -1454,6 +1488,10 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, dsi);

+ ret = rzg2l_mipi_dsi_pwrrdy_init(dsi);
+ if (ret)
+ return ret;
+
pm_runtime_enable(dsi->dev);

ret = pm_runtime_resume_and_get(dsi->dev);
--
2.43.0