[PATCH 2/3] drm/rockchip: vop: Add support for RK3308

From: Chiyuki Akatsuki via B4 Relay

Date: Sun Dec 06 2026 - 06:17:24 EST


From: Chiyuki Akatsuki <thesnowfield@xxxxxxxxxxxx>

Add VOP support for the Rockchip RK3308 SoC:
- Internal RGB LCDC output interface.
- WIN0 (primary, with scaling) and WIN1 (cursor) planes.
- Max output resolution of 1280x800.

Co-developed-by: Yuanpai Zhang <ssp97@xxxxxxxxxxxx>
Signed-off-by: Yuanpai Zhang <ssp97@xxxxxxxxxxxx>
Signed-off-by: Chiyuki Akatsuki <thesnowfield@xxxxxxxxxxxx>
---
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 40 +++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index 72301e0a3..ebafdae4d 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -1234,6 +1234,44 @@ static const struct vop_data rk3506_vop = {
.max_output = { 1280, 1280 },
};

+static const struct vop_output rk3308_output = {
+ .rgb_en = VOP_REG(PX30_DSP_CTRL0, 0x1, 0),
+ .rgb_dclk_pol = VOP_REG(PX30_DSP_CTRL0, 0x1, 1),
+ .rgb_pin_pol = VOP_REG(PX30_DSP_CTRL0, 0x7, 2),
+};
+
+static const struct vop_common rk3308_common = {
+ .standby = VOP_REG_SYNC(PX30_SYS_CTRL2, 0x1, 1),
+ .cfg_done = VOP_REG_SYNC(PX30_REG_CFG_DONE, 0x1, 0),
+ .dsp_blank = VOP_REG(PX30_DSP_CTRL2, 0x1, 14),
+ .dither_down_en = VOP_REG(PX30_DSP_CTRL2, 0x1, 8),
+ .dither_down_sel = VOP_REG(PX30_DSP_CTRL2, 0x1, 7),
+ .dither_down_mode = VOP_REG(PX30_DSP_CTRL2, 0x1, 6),
+ .dither_up = VOP_REG(PX30_DSP_CTRL2, 0x1, 2),
+ .dsp_lut_en = VOP_REG(PX30_DSP_CTRL2, 0x1, 5),
+ .gate_en = VOP_REG(PX30_SYS_CTRL2, 0x1, 0),
+ .out_mode = VOP_REG(PX30_DSP_CTRL2, 0xf, 16),
+};
+
+static const struct vop_win_data rk3308_vop_win_data[] = {
+ { .base = 0x00, .phy = &px30_win0_data,
+ .type = DRM_PLANE_TYPE_PRIMARY },
+ { .base = 0x00, .phy = &px30_win1_data,
+ .type = DRM_PLANE_TYPE_CURSOR },
+};
+
+static const struct vop_data rk3308_vop = {
+ .version = VOP_VERSION(2, 7),
+ .feature = VOP_FEATURE_INTERNAL_RGB,
+ .intr = &px30_intr,
+ .common = &rk3308_common,
+ .modeset = &px30_modeset,
+ .output = &rk3308_output,
+ .win = rk3308_vop_win_data,
+ .win_size = ARRAY_SIZE(rk3308_vop_win_data),
+ .max_output = { 1280, 800 },
+};
+
static const struct vop_common rv1126_common = {
.standby = VOP_REG_SYNC(PX30_SYS_CTRL2, 0x1, 1),
.out_mode = VOP_REG(PX30_DSP_CTRL2, 0xf, 16),
@@ -1302,6 +1340,8 @@ static const struct of_device_id vop_driver_dt_match[] = {
.data = &rk3188_vop },
{ .compatible = "rockchip,rk3288-vop",
.data = &rk3288_vop },
+ { .compatible = "rockchip,rk3308-vop",
+ .data = &rk3308_vop },
{ .compatible = "rockchip,rk3368-vop",
.data = &rk3368_vop },
{ .compatible = "rockchip,rk3366-vop",

--
2.47.3