From 641084c3751a235fd3695c565131e05d150ab0d1 Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Tue, 31 May 2022 17:41:33 +0800 Subject: [PATCH] drm/panel: check panel status before send custom commands drm/panel: Check whether panel is ready, before send custom command. Otherwise, try to enable dsi,but actually fail. Change-Id: Ia34efc2a6fe386e4d713303ce52248ebeb62c5a8 Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2285035 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 59dfb1190d6e..ba67f6a4fb2e 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -1011,6 +1011,11 @@ static int dsi_panel_send_param_cmd(struct dsi_panel *panel, mutex_lock(&panel->panel_lock); + if (!panel->panel_initialized) { + rc = -ENODEV; + goto end; + } + if (param_info->value >= panel_param->val_max) param_info->value = panel_param->val_max - 1;