Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel/sharp-ls043t1le01: Use _multi variants

Move away from using deprecated API and use _multi variants
if available. Use mipi_dsi_msleep() and mipi_dsi_usleep_range()
instead of msleep() and usleep_range() respectively.

Used Coccinelle to find the _multi variant APIs,replacing
mpi_dsi_msleep() where necessary and for returning
dsi_ctx.accum_err in these functions. mipi_dsi_dcs_write()
does not have a corresponding _multi() variant. Replacing it with
mipi_dsi_dcs_write_seq_multi() instead. This change is manual.

The Coccinelle script is the same as the one in commit c8ba07caaecc
("drm/panel/synaptics-r63353: Use _multi variants")

v2: Use mipi_dsi_write_buffer_multi() in place of
mipi_dsi_dcs_write(). (Dmitry)

v3: add commit details where the same coccinelle script is
used and remove the actual script from commit log.
Use mipi_dsi_dcs_write_seq_multi() for mipi_dsi_dcs_write() (Doug)

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Tejas Vipin <tejasvipin76@gmail.com>
Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250326-b4-panel-ls043t1le01-v3-1-96c554c0ea2b@redhat.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Anusha Srivatsa and committed by
Dmitry Baryshkov
20e82192 a53d9877

+15 -26
+15 -26
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
··· 36 36 static int sharp_nt_panel_init(struct sharp_nt_panel *sharp_nt) 37 37 { 38 38 struct mipi_dsi_device *dsi = sharp_nt->dsi; 39 - int ret; 39 + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; 40 40 41 41 dsi->mode_flags |= MIPI_DSI_MODE_LPM; 42 42 43 - ret = mipi_dsi_dcs_exit_sleep_mode(dsi); 44 - if (ret < 0) 45 - return ret; 43 + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); 46 44 47 - msleep(120); 45 + mipi_dsi_msleep(&dsi_ctx, 120); 48 46 49 47 /* Novatek two-lane operation */ 50 - ret = mipi_dsi_dcs_write(dsi, 0xae, (u8[]){ 0x03 }, 1); 51 - if (ret < 0) 52 - return ret; 48 + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xae, 0x03); 53 49 54 50 /* Set both MCU and RGB I/F to 24bpp */ 55 - ret = mipi_dsi_dcs_set_pixel_format(dsi, MIPI_DCS_PIXEL_FMT_24BIT | 56 - (MIPI_DCS_PIXEL_FMT_24BIT << 4)); 57 - if (ret < 0) 58 - return ret; 51 + mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx, 52 + MIPI_DCS_PIXEL_FMT_24BIT | 53 + (MIPI_DCS_PIXEL_FMT_24BIT << 4)); 59 54 60 - return 0; 55 + return dsi_ctx.accum_err; 61 56 } 62 57 63 58 static int sharp_nt_panel_on(struct sharp_nt_panel *sharp_nt) 64 59 { 65 60 struct mipi_dsi_device *dsi = sharp_nt->dsi; 66 - int ret; 61 + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; 67 62 68 63 dsi->mode_flags |= MIPI_DSI_MODE_LPM; 69 64 70 - ret = mipi_dsi_dcs_set_display_on(dsi); 71 - if (ret < 0) 72 - return ret; 65 + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); 73 66 74 - return 0; 67 + return dsi_ctx.accum_err; 75 68 } 76 69 77 70 static int sharp_nt_panel_off(struct sharp_nt_panel *sharp_nt) 78 71 { 79 72 struct mipi_dsi_device *dsi = sharp_nt->dsi; 80 - int ret; 73 + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; 81 74 82 75 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; 83 76 84 - ret = mipi_dsi_dcs_set_display_off(dsi); 85 - if (ret < 0) 86 - return ret; 77 + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); 87 78 88 - ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 89 - if (ret < 0) 90 - return ret; 79 + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); 91 80 92 - return 0; 81 + return dsi_ctx.accum_err; 93 82 } 94 83 95 84 static int sharp_nt_panel_unprepare(struct drm_panel *panel)