diff mbox series

[v2,5/8] drm/mipi-dsi: add set column/page multi helpers

Message ID 20240630-oneplus8-v2-5-c4a1f8da74f1@postmarketos.org
State New
Headers show
Series qcom: initial support for the OnePlus 8T | expand

Commit Message

Caleb Connolly June 30, 2024, 6:36 p.m. UTC
Introduce mipi_dsi_dcs_set_column_address_multi() and
mipi_dsi_dcs_set_page_address_multi() helpers.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
---
 include/drm/drm_mipi_dsi.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Dmitry Baryshkov July 1, 2024, 8:02 p.m. UTC | #1
On Sun, Jun 30, 2024 at 08:36:28PM GMT, Caleb Connolly wrote:
> Introduce mipi_dsi_dcs_set_column_address_multi() and
> mipi_dsi_dcs_set_page_address_multi() helpers.
> 
> Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
> ---
>  include/drm/drm_mipi_dsi.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff mbox series

Patch

diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index fb23f4e3b94e..f390bd261be7 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -434,8 +434,24 @@  void mipi_dsi_dcs_set_tear_on_multi(struct mipi_dsi_multi_context *ctx,
 		static const u8 d[] = { cmd, seq };                     \
 		mipi_dsi_dcs_write_buffer_multi(ctx, d, ARRAY_SIZE(d)); \
 	} while (0)
 
+#define mipi_dsi_dcs_set_column_address_multi(ctx, start, end)          \
+	do {                                                            \
+		static const u8 d[] = { MIPI_DCS_SET_COLUMN_ADDRESS,    \
+					(start) >> 8, (start) & 0xff,   \
+					(end) >> 8, (end) & 0xff };     \
+		mipi_dsi_dcs_write_buffer_multi(ctx, d, ARRAY_SIZE(d)); \
+	} while (0)
+
+#define mipi_dsi_dcs_set_page_address_multi(ctx, start, end)            \
+	do {                                                            \
+		static const u8 d[] = { MIPI_DCS_SET_PAGE_ADDRESS,      \
+					(start) >> 8, (start) & 0xff,   \
+					(end) >> 8, (end) & 0xff };     \
+		mipi_dsi_dcs_write_buffer_multi(ctx, d, ARRAY_SIZE(d)); \
+	} while (0)
+
 /**
  * mipi_dsi_dcs_write_long_multi - transmit a DCS long command with payload
  * @ctx: Context for multiple DSI transactions
  * @cmd: Commands