drm/panel: sharp-ls060t1sx01: transition to mipi_dsi wrapped functions
Subsystems (3)
PATCH 1/1 drm/panel: sharp-ls060t1sx01: transition to mipi_dsi wrapped functions
Changes the sharp-ls060t1sx01 panel to use multi style functions for improved error handling.
Signed-off-by Tejas Vipin <[email protected]>
--- .../gpu/drm/panel/panel-sharp-ls060t1sx01.c | 59 +++++-------------- 1 file changed, 16 insertions(+), 43 deletions(-)
drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c +16 -43
@@ -44,60 +44,39 @@ static void sharp_ls060_reset(struct sharp_ls060 *ctx)static int sharp_ls060_on (struct sharp_ls060 *ctx) {struct mipi_dsi_device *dsi = ctx->dsi; -struct device *dev = &dsi->dev; -int ret; +struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; dsi->mode_flags |=MIPI_DSI_MODE_LPM ; -mipi_dsi_dcs_write_seq (dsi,0xbb ,0x13 ); -mipi_dsi_dcs_write_seq (dsi,MIPI_DCS_WRITE_MEMORY_START ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,0xbb ,0x13 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,MIPI_DCS_WRITE_MEMORY_START ); - ret =mipi_dsi_dcs_exit_sleep_mode (dsi); -if (ret <0 ) { -dev_err (dev,"Failed to exit sleep mode: %d\n" , ret); -return ret; - } -msleep (120 ); +mipi_dsi_dcs_exit_sleep_mode_multi (&dsi_ctx); +mipi_dsi_msleep (&dsi_ctx,120 ); - ret =mipi_dsi_dcs_set_display_on (dsi); -if (ret <0 ) { -dev_err (dev,"Failed to set display on: %d\n" , ret); -return ret; - } -msleep (50 ); +mipi_dsi_dcs_set_display_on_multi (&dsi_ctx); +mipi_dsi_msleep (&dsi_ctx,50 ); -return 0 ; +return dsi_ctx.accum_err; } -static int sharp_ls060_off (struct sharp_ls060 *ctx) +static void sharp_ls060_off (struct sharp_ls060 *ctx) {struct mipi_dsi_device *dsi = ctx->dsi; -struct device *dev = &dsi->dev; -int ret; +struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; dsi->mode_flags &= ~MIPI_DSI_MODE_LPM ; - ret =mipi_dsi_dcs_set_display_off (dsi); -if (ret <0 ) { -dev_err (dev,"Failed to set display off: %d\n" , ret); -return ret; - } -usleep_range (2000 ,3000 ); - - ret =mipi_dsi_dcs_enter_sleep_mode (dsi); -if (ret <0 ) { -dev_err (dev,"Failed to enter sleep mode: %d\n" , ret); -return ret; - } -msleep (121 ); +mipi_dsi_dcs_set_display_off_multi (&dsi_ctx); +mipi_dsi_usleep_range (&dsi_ctx,2000 ,3000 ); -return 0 ; +mipi_dsi_dcs_enter_sleep_mode_multi (&dsi_ctx); +mipi_dsi_msleep (&dsi_ctx,121 ); }static int sharp_ls060_prepare (struct drm_panel *panel) {struct sharp_ls060 *ctx =to_sharp_ls060 (panel); -struct device *dev = &ctx->dsi->dev;int ret; ret =regulator_enable (ctx->vddi_supply);
@@ -125,10 +104,8 @@ static int sharp_ls060_prepare(struct drm_panel *panel)sharp_ls060_reset (ctx); ret =sharp_ls060_on (ctx); -if (ret <0 ) { -dev_err (dev,"Failed to initialize panel: %d\n" , ret); +if (ret <0 ) goto err_on; - }return 0 ;
@@ -154,12 +131,8 @@ static int sharp_ls060_prepare(struct drm_panel *panel)static int sharp_ls060_unprepare (struct drm_panel *panel) {struct sharp_ls060 *ctx =to_sharp_ls060 (panel); -struct device *dev = &ctx->dsi->dev; -int ret; - ret =sharp_ls060_off (ctx); -if (ret <0 ) -dev_err (dev,"Failed to un-initialize panel: %d\n" , ret); +sharp_ls060_off (ctx);regulator_disable (ctx->vddh_supply);
Signature · 1 line
2.48.1
Hi,
Quoted 2 lines · Tejas Vipin
Changes the sharp-ls060t1sx01 panel to use multi style functions for
Not worth spinning for this, but s/Changes/Change/
Quoted 6 lines
improved error handling.
Signed-off-by Tejas Vipin <[email protected]>--- .../gpu/drm/panel/panel-sharp-ls060t1sx01.c | 59 +++++-------------- 1 file changed, 16 insertions(+), 43 deletions(-)
Reviewed-by Douglas Anderson <[email protected]>
I'll wait a few days and apply if there are no objections.
-Doug
Doug Anderson
AppliedHi,
Quoted 11 lines · Doug Anderson
Hi,
Quoted 2 lines · Tejas Vipin
Changes the sharp-ls060t1sx01 panel to use multi style functions for
Not worth spinning for this, but s/Changes/Change/
Quoted 2 lines
improved error handling.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Tejas Vipin <[email protected]>--- .../gpu/drm/panel/panel-sharp-ls060t1sx01.c | 59 +++++-------------- 1 file changed, 16 insertions(+), 43 deletions(-)Reviewed-by Douglas Anderson <[email protected]>I'll wait a few days and apply if there are no objections.
Pushed to drm-misc-next:
[1/1] drm/panel: sharp-ls060t1sx01: transition to mipi_dsi wrapped functions
commit: 7e3bf00047cdfe2b09e9a0d77b99bedc15406bfa