[PATCH] drm/bridge: ti-sn65dsi83: Add Non-Burst mode property

From: stefano . radaelli21
Date: Mon Jul 08 2024 - 11:18:31 EST


From: Stefano Radaelli <stefano.radaelli21@xxxxxxxxx>

The video mode can be divided into two methods for sending packet data:
burst mode and non-burst mode.
In burst mode, pixel data is compressed to save time for the interface
to return to low power.
Non-burst modes transmit pixel data in a stream controlled by sync
pulses or sync events.

Adding this property in the DTS gives the programmer the ability to
disable Burst Mode, depending on how the MIPI controller is configured.

Co-developed-by: Noah J. Rosa <noahj.rosa@xxxxxxxxx>
Signed-off-by: Noah J. Rosa <noahj.rosa@xxxxxxxxx>
Signed-off-by: Stefano Radaelli <stefano.radaelli21@xxxxxxxxx>
---
drivers/gpu/drm/bridge/ti-sn65dsi83.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 57a7ed13f996..6314c03ce1e6 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -145,6 +145,7 @@ struct sn65dsi83 {
struct drm_bridge *panel_bridge;
struct gpio_desc *enable_gpio;
struct regulator *vcc;
+ bool burst_mode;
bool lvds_dual_link;
bool lvds_dual_link_even_odd_swap;
};
@@ -581,6 +582,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
struct drm_bridge *panel_bridge;
struct device *dev = ctx->dev;

+ ctx->burst_mode = !(of_property_read_bool(dev->of_node, "burst-mode-disabled"));
ctx->lvds_dual_link = false;
ctx->lvds_dual_link_even_odd_swap = false;
if (model != MODEL_SN65DSI83) {
@@ -654,10 +656,15 @@ static int sn65dsi83_host_attach(struct sn65dsi83 *ctx)

dsi->lanes = dsi_lanes;
dsi->format = MIPI_DSI_FMT_RGB888;
- dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
MIPI_DSI_MODE_VIDEO_NO_HFP | MIPI_DSI_MODE_VIDEO_NO_HBP |
MIPI_DSI_MODE_VIDEO_NO_HSA | MIPI_DSI_MODE_NO_EOT_PACKET;

+ if (ctx->burst_mode)
+ dsi->mode_flags |= MIPI_DSI_MODE_VIDEO_BURST;
+ else
+ dsi->mode_flags |= MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
+
ret = devm_mipi_dsi_attach(dev, dsi);
if (ret < 0) {
dev_err(dev, "failed to attach dsi to host: %d\n", ret);
--
2.34.1