[PATCH 23/26] video: bridge: samsung: support simple frame-buffer

Dario Binacchi
2024-09-13T10:01:08Z

If you want to pass the frame-buffer to the kernel, the video output is
initialized by U-Boot, and kept by the kernel. The patch does not turn
off the power domains or disable the peripheral if you want to support
such feature.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

drivers/video/bridge/samsung-dsi-host.c | 9 +++++++++
drivers/video/bridge/samsung-dsim.c | 3 +++
2 files changed, 12 insertions(+)

diff --git a/drivers/video/bridge/samsung-dsi-host.c b/drivers/video/bridge/samsung-dsi-host.c
index dd3e33c4edc7..2d0e8f71a756 100644
--- a/drivers/video/bridge/samsung-dsi-host.c
+++ b/drivers/video/bridge/samsung-dsi-host.c
@@ -1281,6 +1281,7 @@ static void samsung_dsi_set_standby(struct samsung_dsi *dsim, bool standby)
samsung_dsim_write(dsim, DSIM_MDRESOL_REG, mdresol);
}

+#if (!IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB))
static void samsung_dsi_disable_clock(struct samsung_dsi *dsim)
{
u32 reg;
@@ -1294,6 +1295,7 @@ static void samsung_dsi_disable_clock(struct samsung_dsi *dsim)
reg &= ~DSIM_PLL_EN;
samsung_dsim_write(dsim, DSIM_PLLCTRL_REG, reg);
}
+#endif

static inline struct samsung_dsi *host_to_dsi(struct mipi_dsi_host *host)
{
@@ -1515,6 +1517,12 @@ static int samsung_dsi_enable(struct udevice *dev)
return 0;
}

+#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)
+static int samsung_dsi_disable(struct udevice *dev)
+{
+ return 0;
+}
+#else
static int samsung_dsi_disable(struct udevice *dev)
{
u32 intsrc;
@@ -1532,6 +1540,7 @@ static int samsung_dsi_disable(struct udevice *dev)

return 0;
}
+#endif

struct dsi_host_ops samsung_dsi_ops = {
.init = samsung_dsi_init,
diff --git a/drivers/video/bridge/samsung-dsim.c b/drivers/video/bridge/samsung-dsim.c
index 986f1d830844..36e45abb3009 100644
--- a/drivers/video/bridge/samsung-dsim.c
+++ b/drivers/video/bridge/samsung-dsim.c
@@ -144,5 +144,8 @@ U_BOOT_DRIVER(samsung_dsim) = {
.remove = samsung_dsim_remove,
.probe = samsung_dsim_probe,
.ops = &samsung_dsim_ops,
+#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)
+ .flags = DM_FLAG_LEAVE_PD_ON,
+#endif
.priv_auto = sizeof(struct samsung_dsim_priv),
};
--
2.43.0