[PATCH v10 11/12] drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support
From: Tommaso Merciai
Date: Fri Nov 13 2026 - 07:38:58 EST
The RZ/G3E (R9A09G047) has two DU instances which can both drive the
DSI encoder and channel 1 of the LVDS encoder. Expose them through a
single DRM device.
Request the LVDS duty cycle for the new LVDS channel 1 output as well.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@xxxxxxxxxxxxxx>
---
v9->v10:
- Dropped rzg2l_du_subsystem.c and the separate DU instance platform
driver. All SoCs now go through the same probe path and the first
available RZ/G3E DU instance acts as component master.
- Split the driver preparation into separate patches.
- Reworked commit body.
v8->v9:
- Added newly architetture support creating an ad hoc component
driver for RZ/G3E display subsystem that embed the 2 du instances
into single drm device.
v7->v8:
- Modelled using ports/port instead of port/ep.
- Rebased on top of RZ/G3L du support [1]
[1] https://lore.kernel.org/all/20260826174854.199139-1-biju.das.jz@xxxxxxxxxxxxxx/
- Added mode_clock_min, mode_clock_max for parallel output.
- Improved commit msg and commit body.
v6->v7:
- Removed feature flag usage, rebased on top of T2H/N2H LCDC series [1]
[1] https://patchwork.global.renesas.com/project/spl2-reviews/list/?series=694&state=%2A&archive=both
- Reworked commit body as now outputs routing is based on endpoint id
instead of port number.
- Fixed rzg2l_du_r9a09g047_info instead of rzg2l_du_r9a09g047_du_info.
- Added bump of RZG2L_DU_MAX_CRTCS and RZG2L_DU_MAX_VSPS to 2.
v5->v6:
- Aligned ports numbering with the bindings changes.
v4->v5:
- Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
update commit body accordingly.
- Added features field documentation.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Instead of using clk-provider API to select the right parent clock,
based on the outputs. Just set the correct duty cycle based on the
output, this reflects at CPG lvl to select the right parent.
- Updated commit message accordingly.
drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 29 ++++++++++++++++++-
drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 3 +-
.../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 3 +-
3 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index 873586f2ef28..bd8f4c9f1f29 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -79,6 +79,31 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a08g046_info = {
.mode_clock_max = 87000,
};
+static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_info = {
+ .channels_mask = BIT(0),
+ .routes = {
+ [RZG2L_DU_OUTPUT_DSI0] = {
+ .possible_outputs = BIT(0),
+ .port = 0,
+ },
+ [RZG2L_DU_OUTPUT_DPAD0] = {
+ .possible_outputs = BIT(0),
+ .port = 1,
+ },
+ [RZG2L_DU_OUTPUT_LVDS0] = {
+ .possible_outputs = BIT(0),
+ .port = 2,
+ },
+ [RZG2L_DU_OUTPUT_LVDS1] = {
+ .possible_outputs = BIT(0),
+ .port = 3,
+ },
+ },
+ .features = RZG2L_DU_FEATURE_COMPONENT,
+ .mode_clock_min = 5400,
+ .mode_clock_max = 87000,
+};
+
static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
.channels_mask = BIT(0),
.routes = {
@@ -106,6 +131,7 @@ static const struct of_device_id rzg2l_du_of_table[] = {
{ .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
{ .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
{ .compatible = "renesas,r9a08g046-du", .data = &rzg2l_du_r9a08g046_info },
+ { .compatible = "renesas,r9a09g047-du", .data = &rzg2l_du_r9a09g047_info },
{ .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
{ .compatible = "renesas,r9a09g077-du", .data = &rzg2l_du_r9a09g077_info },
{ /* sentinel */ }
@@ -118,7 +144,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output)
static const char * const names[] = {
[RZG2L_DU_OUTPUT_DSI0] = "DSI0",
[RZG2L_DU_OUTPUT_DPAD0] = "DPAD0",
- [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0"
+ [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
+ [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1"
};
if (output >= ARRAY_SIZE(names))
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index 4c2e12206d83..2a5bd00e692e 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -27,6 +27,7 @@ enum rzg2l_du_output {
RZG2L_DU_OUTPUT_DSI0,
RZG2L_DU_OUTPUT_DPAD0,
RZG2L_DU_OUTPUT_LVDS0,
+ RZG2L_DU_OUTPUT_LVDS1,
RZG2L_DU_OUTPUT_MAX,
};
@@ -35,7 +36,7 @@ enum rzg2l_du_output {
* @possible_outputs: bitmask of possible outputs
* @port: device tree port number corresponding to this output route
*
- * The DU has 3 possible outputs (DPAD0, DSI0, LVDS0). Output routing data
+ * The DU has 4 possible outputs (DPAD0, DSI0, LVDS0/1). Output routing data
* specify the valid SoC outputs, which CRTC can drive the output, and the type
* of in-SoC encoder for the output.
*/
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
index 45f980ea3c20..60709e0fc601 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
@@ -80,7 +80,8 @@ static void rzg2l_du_encoder_atomic_mode_set(struct drm_encoder *encoder,
* - LVDS path has DUTY H/L=4/3, 4/7 duty cycle.
* - DSI/RGB path has symmetric 50% duty cycle.
*/
- if (renc->output == RZG2L_DU_OUTPUT_LVDS0)
+ if (renc->output == RZG2L_DU_OUTPUT_LVDS0 ||
+ renc->output == RZG2L_DU_OUTPUT_LVDS1)
clk_set_duty_cycle(clk_parent, 4, 7);
else
clk_set_duty_cycle(clk_parent, 1, 2);
--
2.54.0