From 3ceb892a708a0cf04e2d272e57c31fd1ff07d5e0 Mon Sep 17 00:00:00 2001 From: Xiaojun Lv Date: Wed, 22 Jun 2022 15:46:28 +0800 Subject: [PATCH] msm/drm:compatible with different hbm table in panel msm/drm: according panel_ver compatible with different hbm table in panel Change-Id: I9eb47dab28d7b38d5687be0b322493347478f22f Reviewed-on: https://gerrit.mot.com/2309365 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan Reviewed-by: Yeqing Wang Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 68d4ab617340..dfdda739db7c 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -4204,6 +4204,8 @@ static int dsi_panel_parse_local_hbm_config(struct dsi_panel *panel) { int rc = 0; u32 size; + struct device_node *np; + char hbm_table_name[64]; struct dsi_panel_lhbm_config *lhbm_config; struct dsi_parser_utils *utils = &panel->utils; @@ -4233,15 +4235,31 @@ static int dsi_panel_parse_local_hbm_config(struct dsi_panel *panel) return rc; } + np = of_find_node_by_path("/chosen"); + of_property_read_u64(np, "mmi,panel_ver", &panel->panel_ver); + of_node_put(np); + + snprintf(hbm_table_name, sizeof(hbm_table_name), + "qcom,mdss-dsi-panel-local-hbm-alpha-%0x-table", panel->panel_ver); + rc = utils->read_u32_array(utils->data, + hbm_table_name, + lhbm_config->alpha, + lhbm_config->alpha_size); + if (rc) { + rc = utils->read_u32_array(utils->data, "qcom,mdss-dsi-panel-local-hbm-alpha-table", lhbm_config->alpha, lhbm_config->alpha_size); - if (rc) { - DSI_ERR("%s:%d, Unable to read local hbm alpha table,rc:%u\n", - __func__, __LINE__, rc); - lhbm_config->enable = false; - return rc; + if (rc) { + DSI_ERR("%s:%d, Unable to read local hbm alpha table,rc:%u\n", + __func__, __LINE__, rc); + lhbm_config->enable = false; + return rc; + } + } else { + DSI_INFO("%s:%d, use specified table:%s\n", + __func__, __LINE__, hbm_table_name); } rc = utils->read_u32(utils->data,