disp: msm: dsi: fix gpio warning message

At present, the sim panels and physical panels booting up as sim
panels have a call flow issue causing reset gpio to be set in the
panel reset sequence even without valid reset gpio. This causes
GPIO warnings as it tries to set value for invalid reset GPIO.
The following change fixes these GPIO warnings, by checking
valid reset GPIO before setting value.

Change-Id: Id8f54a563c61dd3d244d31b10081042e376287d4
Signed-off-by: Santosh Kumar Aenugu <santoshkumar@codeaurora.org>
This commit is contained in:
Santosh Kumar Aenugu
2021-05-20 20:21:34 -07:00
parent 4a9b41b801
commit 8d9384423c
2 changed files with 13 additions and 7 deletions

View File

@@ -4147,10 +4147,8 @@ static bool dsi_display_validate_panel_resources(struct dsi_display *display)
DSI_ERR("invalid reset gpio for the panel\n"); DSI_ERR("invalid reset gpio for the panel\n");
return false; return false;
} }
} else {
display->panel->power_info.count = 0;
DSI_DEBUG("no dir set and no request for gpios in sim panel\n");
} }
return true; return true;
} }
@@ -4195,8 +4193,10 @@ static int dsi_display_res_init(struct dsi_display *display)
display->panel->te_using_watchdog_timer |= display->sw_te_using_wd; display->panel->te_using_watchdog_timer |= display->sw_te_using_wd;
if (!dsi_display_validate_panel_resources(display)) if (!dsi_display_validate_panel_resources(display)) {
goto error_ctrl_put; rc = -EINVAL;
goto error_panel_put;
}
display_for_each_ctrl(i, display) { display_for_each_ctrl(i, display) {
struct msm_dsi_phy *phy = display->ctrl[i].phy; struct msm_dsi_phy *phy = display->ctrl[i].phy;
@@ -4223,13 +4223,13 @@ static int dsi_display_res_init(struct dsi_display *display)
rc = dsi_display_parse_lane_map(display); rc = dsi_display_parse_lane_map(display);
if (rc) { if (rc) {
DSI_ERR("Lane map not found, rc=%d\n", rc); DSI_ERR("Lane map not found, rc=%d\n", rc);
goto error_ctrl_put; goto error_panel_put;
} }
rc = dsi_display_clocks_init(display); rc = dsi_display_clocks_init(display);
if (rc) { if (rc) {
DSI_ERR("Failed to parse clock data, rc=%d\n", rc); DSI_ERR("Failed to parse clock data, rc=%d\n", rc);
goto error_ctrl_put; goto error_panel_put;
} }
/** /**
@@ -4245,6 +4245,8 @@ static int dsi_display_res_init(struct dsi_display *display)
} }
return 0; return 0;
error_panel_put:
dsi_panel_put(display->panel);
error_ctrl_put: error_ctrl_put:
for (i = i - 1; i >= 0; i--) { for (i = i - 1; i >= 0; i--) {
ctrl = &display->ctrl[i]; ctrl = &display->ctrl[i];

View File

@@ -247,6 +247,9 @@ static int dsi_panel_reset(struct dsi_panel *panel)
struct dsi_panel_reset_config *r_config = &panel->reset_config; struct dsi_panel_reset_config *r_config = &panel->reset_config;
int i; int i;
if (!gpio_is_valid(r_config->reset_gpio))
goto skip_reset_gpio;
if (gpio_is_valid(panel->reset_config.disp_en_gpio)) { if (gpio_is_valid(panel->reset_config.disp_en_gpio)) {
rc = gpio_direction_output(panel->reset_config.disp_en_gpio, 1); rc = gpio_direction_output(panel->reset_config.disp_en_gpio, 1);
if (rc) { if (rc) {
@@ -274,6 +277,7 @@ static int dsi_panel_reset(struct dsi_panel *panel)
(r_config->sequence[i].sleep_ms * 1000) + 100); (r_config->sequence[i].sleep_ms * 1000) + 100);
} }
skip_reset_gpio:
if (gpio_is_valid(panel->bl_config.en_gpio)) { if (gpio_is_valid(panel->bl_config.en_gpio)) {
rc = gpio_direction_output(panel->bl_config.en_gpio, 1); rc = gpio_direction_output(panel->bl_config.en_gpio, 1);
if (rc) if (rc)