* [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup
@ 2024-08-20 9:15 Tejas Vipin
2024-08-20 9:15 ` [PATCH v2 1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions Tejas Vipin
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Tejas Vipin @ 2024-08-20 9:15 UTC (permalink / raw)
To: agx, kernel, neil.armstrong
Cc: dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann,
airlied, daniel, dri-devel, linux-kernel, Tejas Vipin
Uses mipi_dsi_*_multi function in the mantix-mlaf057we51 panel and
converting uppercase hex to lowercase hex for cleanup.
---
Changes in v2:
- Split cleanup changes into separate patch
v1: https://lore.kernel.org/all/20240818072356.870465-1-tejasvipin76@gmail.com/
---
Tejas Vipin (2):
drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped
functions
drm/panel: mantix-mlaf057we51: write hex in lowercase
.../gpu/drm/panel/panel-mantix-mlaf057we51.c | 79 +++++++------------
1 file changed, 27 insertions(+), 52 deletions(-)
--
2.46.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions 2024-08-20 9:15 [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Tejas Vipin @ 2024-08-20 9:15 ` Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase Tejas Vipin 2024-08-20 9:31 ` [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Neil Armstrong 2 siblings, 0 replies; 6+ messages in thread From: Tejas Vipin @ 2024-08-20 9:15 UTC (permalink / raw) To: agx, kernel, neil.armstrong Cc: dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, dri-devel, linux-kernel, Tejas Vipin Changes the mantix-mlaf057we51 panel to use multi style functions for improved error handling. Reviewed-by: Guido Günther <agx@sigxcpu.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com> --- .../gpu/drm/panel/panel-mantix-mlaf057we51.c | 77 +++++++------------ 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c index ea4a6bf6d35b..2a365eaa4ad4 100644 --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c @@ -45,82 +45,57 @@ static inline struct mantix *panel_to_mantix(struct drm_panel *panel) return container_of(panel, struct mantix, panel); } -static int mantix_init_sequence(struct mantix *ctx) +static void mantix_init_sequence(struct mipi_dsi_multi_context *dsi_ctx) { - struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); - struct device *dev = ctx->dev; - /* * Init sequence was supplied by the panel vendor. */ - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A); - - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_INT_CANCEL, 0x03); - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03); - mipi_dsi_generic_write_seq(dsi, 0x80, 0xA9, 0x00); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A); - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09); - mipi_dsi_generic_write_seq(dsi, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00); - msleep(20); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_INT_CANCEL, 0x03); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03); + mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xA9, 0x00); - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_SPI_FINISH, 0xA5); - mipi_dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F); - msleep(20); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09); + mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00); + mipi_dsi_msleep(dsi_ctx, 20); - dev_dbg(dev, "Panel init sequence done\n"); - return 0; + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xA5); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F); + mipi_dsi_msleep(dsi_ctx, 20); } static int mantix_enable(struct drm_panel *panel) { struct mantix *ctx = panel_to_mantix(panel); - struct device *dev = ctx->dev; - struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); - int ret; + struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; - ret = mantix_init_sequence(ctx); - if (ret < 0) { - dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); - return ret; - } + mantix_init_sequence(&dsi_ctx); + if (!dsi_ctx.accum_err) + dev_dbg(ctx->dev, "Panel init sequence done\n"); - ret = mipi_dsi_dcs_exit_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to exit sleep mode\n"); - return ret; - } - msleep(20); + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 20); - ret = mipi_dsi_dcs_set_display_on(dsi); - if (ret) - return ret; - usleep_range(10000, 12000); + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + mipi_dsi_usleep_range(&dsi_ctx, 10000, 12000); - ret = mipi_dsi_turn_on_peripheral(dsi); - if (ret < 0) { - dev_err(dev, "Failed to turn on peripheral\n"); - return ret; - } + mipi_dsi_turn_on_peripheral_multi(&dsi_ctx); - return 0; + return dsi_ctx.accum_err; } static int mantix_disable(struct drm_panel *panel) { struct mantix *ctx = panel_to_mantix(panel); struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); - int ret; - - ret = mipi_dsi_dcs_set_display_off(dsi); - if (ret < 0) - dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret); + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; - ret = mipi_dsi_dcs_enter_sleep_mode(dsi); - if (ret < 0) - dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); - - return 0; + return dsi_ctx.accum_err; } static int mantix_unprepare(struct drm_panel *panel) -- 2.46.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase 2024-08-20 9:15 [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions Tejas Vipin @ 2024-08-20 9:15 ` Tejas Vipin 2024-08-20 9:25 ` neil.armstrong 2024-08-20 9:37 ` Guido Günther 2024-08-20 9:31 ` [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Neil Armstrong 2 siblings, 2 replies; 6+ messages in thread From: Tejas Vipin @ 2024-08-20 9:15 UTC (permalink / raw) To: agx, kernel, neil.armstrong Cc: dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, dri-devel, linux-kernel, Tejas Vipin Converts uppercase hex to lowercase hex for cleanup. Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com> --- drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c index 2a365eaa4ad4..4db852ffb0f6 100644 --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c @@ -23,7 +23,7 @@ /* Manufacturer specific Commands send via DSI */ #define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41 -#define MANTIX_CMD_INT_CANCEL 0x4C +#define MANTIX_CMD_INT_CANCEL 0x4c #define MANTIX_CMD_SPI_FINISH 0x90 struct mantix { @@ -50,18 +50,18 @@ static void mantix_init_sequence(struct mipi_dsi_multi_context *dsi_ctx) /* * Init sequence was supplied by the panel vendor. */ - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a); mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_INT_CANCEL, 0x03); - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03); - mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xA9, 0x00); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x03); + mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xa9, 0x00); - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x09); mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00); mipi_dsi_msleep(dsi_ctx, 20); - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xA5); - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xa5); + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2f); mipi_dsi_msleep(dsi_ctx, 20); } -- 2.46.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase 2024-08-20 9:15 ` [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase Tejas Vipin @ 2024-08-20 9:25 ` neil.armstrong 2024-08-20 9:37 ` Guido Günther 1 sibling, 0 replies; 6+ messages in thread From: neil.armstrong @ 2024-08-20 9:25 UTC (permalink / raw) To: Tejas Vipin, agx, kernel Cc: dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, dri-devel, linux-kernel On 20/08/2024 11:15, Tejas Vipin wrote: > Converts uppercase hex to lowercase hex for cleanup. > > Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com> > --- > drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > index 2a365eaa4ad4..4db852ffb0f6 100644 > --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > @@ -23,7 +23,7 @@ > > /* Manufacturer specific Commands send via DSI */ > #define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41 > -#define MANTIX_CMD_INT_CANCEL 0x4C > +#define MANTIX_CMD_INT_CANCEL 0x4c > #define MANTIX_CMD_SPI_FINISH 0x90 > > struct mantix { > @@ -50,18 +50,18 @@ static void mantix_init_sequence(struct mipi_dsi_multi_context *dsi_ctx) > /* > * Init sequence was supplied by the panel vendor. > */ > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a); > > mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_INT_CANCEL, 0x03); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xA9, 0x00); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x03); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xa9, 0x00); > > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x09); > mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00); > mipi_dsi_msleep(dsi_ctx, 20); > > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xA5); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xa5); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2f); > mipi_dsi_msleep(dsi_ctx, 20); > } > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase 2024-08-20 9:15 ` [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase Tejas Vipin 2024-08-20 9:25 ` neil.armstrong @ 2024-08-20 9:37 ` Guido Günther 1 sibling, 0 replies; 6+ messages in thread From: Guido Günther @ 2024-08-20 9:37 UTC (permalink / raw) To: Tejas Vipin Cc: kernel, neil.armstrong, dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, dri-devel, linux-kernel Hi, On Tue, Aug 20, 2024 at 02:45:54PM +0530, Tejas Vipin wrote: > Converts uppercase hex to lowercase hex for cleanup. > > Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com> > --- > drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > index 2a365eaa4ad4..4db852ffb0f6 100644 > --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > @@ -23,7 +23,7 @@ > > /* Manufacturer specific Commands send via DSI */ > #define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41 > -#define MANTIX_CMD_INT_CANCEL 0x4C > +#define MANTIX_CMD_INT_CANCEL 0x4c > #define MANTIX_CMD_SPI_FINISH 0x90 > > struct mantix { > @@ -50,18 +50,18 @@ static void mantix_init_sequence(struct mipi_dsi_multi_context *dsi_ctx) > /* > * Init sequence was supplied by the panel vendor. > */ > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a); > > mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_INT_CANCEL, 0x03); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x03); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xA9, 0x00); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x03); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0xa9, 0x00); > > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5A, 0x09); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x5a, 0x09); > mipi_dsi_generic_write_seq_multi(dsi_ctx, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00); > mipi_dsi_msleep(dsi_ctx, 20); > > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xA5); > - mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_SPI_FINISH, 0xa5); > + mipi_dsi_generic_write_seq_multi(dsi_ctx, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2f); > mipi_dsi_msleep(dsi_ctx, 20); > } Reviewed-by: Guido Günther <agx@sigxcpu.org> Cheers, -- Guido > > -- > 2.46.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup 2024-08-20 9:15 [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase Tejas Vipin @ 2024-08-20 9:31 ` Neil Armstrong 2 siblings, 0 replies; 6+ messages in thread From: Neil Armstrong @ 2024-08-20 9:31 UTC (permalink / raw) To: agx, kernel, Tejas Vipin Cc: dianders, quic_jesszhan, maarten.lankhorst, mripard, tzimmermann, airlied, daniel, dri-devel, linux-kernel Hi, On Tue, 20 Aug 2024 14:45:52 +0530, Tejas Vipin wrote: > Uses mipi_dsi_*_multi function in the mantix-mlaf057we51 panel and > converting uppercase hex to lowercase hex for cleanup. > Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next) [1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/e139c0eb22ce5b2ab6a2056c1ff495f3a38322d7 [2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/b61c4bc674c6032827f2682a0c72ff577c36143f -- Neil ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-20 9:38 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-08-20 9:15 [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 1/2] drm/panel: mantix-mlaf057we51: transition to mipi_dsi wrapped functions Tejas Vipin 2024-08-20 9:15 ` [PATCH v2 2/2] drm/panel: mantix-mlaf057we51: write hex in lowercase Tejas Vipin 2024-08-20 9:25 ` neil.armstrong 2024-08-20 9:37 ` Guido Günther 2024-08-20 9:31 ` [PATCH v2 0/2] convert mantix-mlaf057we51 to use multi style functions and cleanup Neil Armstrong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox