diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index bae28b81926d..b315be2360c1 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -5031,6 +5031,19 @@ static void dsi_display_validate_dms_fps(struct dsi_display_mode *cur_mode, } } +static int dsi_phy_update_mipi_driver_strength(struct dsi_panel *panel, struct msm_dsi_phy *phy) +{ + if((panel == NULL) || (phy == NULL)) + { + return 1; + } + + phy->cfg.dsi_phy_rescode_top = panel->glbl_rescode_top_ctrl; + phy->cfg.dsi_phy_rescode_bot = panel->glbl_rescode_bot_ctrl; + return 0; + +} + static int dsi_display_set_mode_sub(struct dsi_display *display, struct dsi_display_mode *mode, @@ -5157,6 +5170,7 @@ static int dsi_display_set_mode_sub(struct dsi_display *display, DSI_ERR("failed to add DSI PHY timing params\n"); } } + dsi_phy_update_mipi_driver_strength(display->panel, ctrl->phy); error: return rc; } diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 059d1509c977..c912f8d671ed 100755 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -2729,6 +2729,7 @@ error: static int dsi_panel_parse_misc_features(struct dsi_panel *panel) { struct dsi_parser_utils *utils = &panel->utils; + int mipi_temp = -1; panel->ulps_feature_enabled = utils->read_bool(utils->data, "qcom,ulps-enabled"); @@ -2758,6 +2759,23 @@ static int dsi_panel_parse_misc_features(struct dsi_panel *panel) panel->reset_config.reset_force_pull_low = of_property_read_bool(utils->data, "qcom,mdss-dsi-reset-force-pull-low"); + if(!(utils->read_u32(utils->data,"qcom,mipi-glbl-rescode-top-ctrl", &mipi_temp))) + { + panel->glbl_rescode_top_ctrl = mipi_temp; + } + else + { + panel->glbl_rescode_top_ctrl = -1; + } + if(!(utils->read_u32(utils->data,"qcom,mipi-glbl-rescode-bot-ctrl", &mipi_temp))) + { + panel->glbl_rescode_bot_ctrl = mipi_temp; + } + else + { + panel->glbl_rescode_bot_ctrl = -1; + } + return 0; } diff --git a/msm/dsi/dsi_panel.h b/msm/dsi/dsi_panel.h index 8fa8f29291bb..0c620948f9d4 100644 --- a/msm/dsi/dsi_panel.h +++ b/msm/dsi/dsi_panel.h @@ -364,6 +364,9 @@ struct dsi_panel { enum touch_state tp_state; bool tp_state_check_enable; + + int glbl_rescode_top_ctrl; + int glbl_rescode_bot_ctrl; }; static inline bool dsi_panel_ulps_feature_enabled(struct dsi_panel *panel) diff --git a/msm/dsi/dsi_phy_hw_v4_0.c b/msm/dsi/dsi_phy_hw_v4_0.c index d33eea206452..50f4839dca53 100644 --- a/msm/dsi/dsi_phy_hw_v4_0.c +++ b/msm/dsi/dsi_phy_hw_v4_0.c @@ -355,6 +355,14 @@ static void dsi_phy_hw_dphy_enable(struct dsi_phy_hw *phy, vreg_ctrl_0 = less_than_1500_mhz ? 0x53 : 0x52; glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : 0x00; glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : 0x3c; + if(cfg->dsi_phy_rescode_top >= 0) + { + glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : cfg->dsi_phy_rescode_top; + } + if(cfg->dsi_phy_rescode_bot >= 0) + { + glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : cfg->dsi_phy_rescode_bot; + } glbl_str_swi_cal_sel_ctrl = 0x00; glbl_hstx_str_ctrl_0 = 0x88; } else {