Преглед на файлове

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 <[email protected]>
Santosh Kumar Aenugu преди 4 години
родител
ревизия
8d9384423c
променени са 2 файла, в които са добавени 13 реда и са изтрити 7 реда
  1. 9 7
      msm/dsi/dsi_display.c
  2. 4 0
      msm/dsi/dsi_panel.c

+ 9 - 7
msm/dsi/dsi_display.c

@@ -4147,10 +4147,8 @@ static bool dsi_display_validate_panel_resources(struct dsi_display *display)
 			DSI_ERR("invalid reset gpio for the panel\n");
 			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;
 }
 
@@ -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;
 
-	if (!dsi_display_validate_panel_resources(display))
-		goto error_ctrl_put;
+	if (!dsi_display_validate_panel_resources(display)) {
+		rc = -EINVAL;
+		goto error_panel_put;
+	}
 
 	display_for_each_ctrl(i, display) {
 		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);
 	if (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);
 	if (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;
+error_panel_put:
+	dsi_panel_put(display->panel);
 error_ctrl_put:
 	for (i = i - 1; i >= 0; i--) {
 		ctrl = &display->ctrl[i];

+ 4 - 0
msm/dsi/dsi_panel.c

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