msm: mdss: Fix panel ESD detection mode selection
Panel ESD detection supports few different methods, and should determine the detection mode before checking the correct DT value. This change make sure BTA and TE detection mode does not need to care for REG read DT settings. CRs-Fixed: 1035341 Change-Id: Ib3070f739571fa73684a9c88c35d9af42bca9850 Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
This commit is contained in:
parent
d822846701
commit
5cf7b9f177
1 changed files with 33 additions and 30 deletions
|
@ -1638,6 +1638,38 @@ static void mdss_dsi_parse_esd_params(struct device_node *np,
|
|||
if (!pinfo->esd_check_enabled)
|
||||
return;
|
||||
|
||||
ctrl->status_mode = ESD_MAX;
|
||||
rc = of_property_read_string(np,
|
||||
"qcom,mdss-dsi-panel-status-check-mode", &string);
|
||||
if (!rc) {
|
||||
if (!strcmp(string, "bta_check")) {
|
||||
ctrl->status_mode = ESD_BTA;
|
||||
} else if (!strcmp(string, "reg_read")) {
|
||||
ctrl->status_mode = ESD_REG;
|
||||
ctrl->check_read_status =
|
||||
mdss_dsi_gen_read_status;
|
||||
} else if (!strcmp(string, "reg_read_nt35596")) {
|
||||
ctrl->status_mode = ESD_REG_NT35596;
|
||||
ctrl->status_error_count = 0;
|
||||
ctrl->check_read_status =
|
||||
mdss_dsi_nt35596_read_status;
|
||||
} else if (!strcmp(string, "te_signal_check")) {
|
||||
if (pinfo->mipi.mode == DSI_CMD_MODE) {
|
||||
ctrl->status_mode = ESD_TE;
|
||||
} else {
|
||||
pr_err("TE-ESD not valid for video mode\n");
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
pr_err("No valid panel-status-check-mode string\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ctrl->status_mode == ESD_BTA) || (ctrl->status_mode == ESD_TE) ||
|
||||
(ctrl->status_mode == ESD_MAX))
|
||||
return;
|
||||
|
||||
mdss_dsi_parse_dcs_cmds(np, &ctrl->status_cmds,
|
||||
"qcom,mdss-dsi-panel-status-command",
|
||||
"qcom,mdss-dsi-panel-status-command-state");
|
||||
|
@ -1693,43 +1725,14 @@ static void mdss_dsi_parse_esd_params(struct device_node *np,
|
|||
memset(ctrl->status_value, 0, ctrl->groups * status_len);
|
||||
}
|
||||
|
||||
ctrl->status_mode = ESD_MAX;
|
||||
rc = of_property_read_string(np,
|
||||
"qcom,mdss-dsi-panel-status-check-mode", &string);
|
||||
if (!rc) {
|
||||
if (!strcmp(string, "bta_check")) {
|
||||
ctrl->status_mode = ESD_BTA;
|
||||
} else if (!strcmp(string, "reg_read")) {
|
||||
ctrl->status_mode = ESD_REG;
|
||||
ctrl->check_read_status =
|
||||
mdss_dsi_gen_read_status;
|
||||
} else if (!strcmp(string, "reg_read_nt35596")) {
|
||||
ctrl->status_mode = ESD_REG_NT35596;
|
||||
ctrl->status_error_count = 0;
|
||||
ctrl->check_read_status =
|
||||
mdss_dsi_nt35596_read_status;
|
||||
} else if (!strcmp(string, "te_signal_check")) {
|
||||
if (pinfo->mipi.mode == DSI_CMD_MODE) {
|
||||
ctrl->status_mode = ESD_TE;
|
||||
} else {
|
||||
pr_err("TE-ESD not valid for video mode\n");
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
pr_err("No valid panel-status-check-mode string\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
kfree(ctrl->return_buf);
|
||||
error2:
|
||||
kfree(ctrl->status_value);
|
||||
error1:
|
||||
kfree(ctrl->status_valid_params);
|
||||
kfree(ctrl->status_cmds_rlen);
|
||||
error:
|
||||
pinfo->esd_check_enabled = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue