Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cbed15b authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Avoid GPIO warnings during boot up



During continuous splash screen handoff, we see GPIO
warnings since we try to free the GPIOs without
requesting them before. This change takes care of avoiding
these warnings.

Change-Id: I574bcf0bd28e3c33dca618103cf0285675917189
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent 9b02e768
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1216,6 +1216,13 @@ static int msm_dsi_cont_on(struct mdss_panel_data *pdata)
		mutex_unlock(&ctrl_pdata->mutex);
		return ret;
	}
	pinfo->panel_power_on = 1;
	ret = mdss_dsi_panel_reset(pdata, 1);
	if (ret) {
		pr_err("%s: Panel reset failed\n", __func__);
		mutex_unlock(&ctrl_pdata->mutex);
		return ret;
	}

	msm_dsi_ahb_ctrl(1);
	msm_dsi_prepare_clocks();
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ static int dsi_panel_handler(struct mdss_panel_data *pdata, int enable)
	if (enable) {
		dsi_ctrl_gpio_request(ctrl_pdata);
		mdss_dsi_panel_reset(pdata, 1);
		pdata->panel_info.panel_power_on = 1;
		rc = ctrl_pdata->on(pdata);
		if (rc)
			pr_err("dsi_panel_handler panel on failed %d\n", rc);
@@ -73,6 +74,7 @@ static int dsi_panel_handler(struct mdss_panel_data *pdata, int enable)
		if (dsi_intf.op_mode_config)
			dsi_intf.op_mode_config(DSI_CMD_MODE, pdata);
		rc = ctrl_pdata->off(pdata);
		pdata->panel_info.panel_power_on = 0;
		mdss_dsi_panel_reset(pdata, 0);
		dsi_ctrl_gpio_free(ctrl_pdata);
	}
+9 −11
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
			goto error;
		}

		if (pdata->panel_info.panel_power_on == 0) {
		ret = mdss_dsi_panel_reset(pdata, 1);
		if (ret) {
			pr_err("%s: Panel reset failed. rc=%d\n",
@@ -85,7 +84,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
				pr_err("Disable vregs failed\n");
			goto error;
		}
		}
	} else {

		ret = mdss_dsi_panel_reset(pdata, 0);
+0 −4
Original line number Diff line number Diff line
@@ -253,11 +253,7 @@ struct mdss_dsi_ctrl_pdata {
	int disp_te_gpio;
	int bklt_en_gpio;
	int mode_gpio;
	int rst_gpio_requested;
	int disp_en_gpio_requested;
	int disp_te_gpio_requested;
	int mode_gpio_requested;
	int bklt_en_gpio_requested;
	int bklt_ctrl;	/* backlight ctrl */
	int pwm_period;
	int pwm_pmic_gpio;
+13 −17
Original line number Diff line number Diff line
@@ -207,7 +207,6 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
{
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	struct mdss_panel_info *pinfo = NULL;
	static bool gpio_request_done;
	int i, rc = 0;

	if (pdata == NULL) {
@@ -232,16 +231,13 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
	pr_debug("%s: enable = %d\n", __func__, enable);
	pinfo = &(ctrl_pdata->panel_data.panel_info);

	if (!gpio_request_done && enable) {
	if (enable) {
		rc = mdss_dsi_request_gpios(ctrl_pdata);
		if (rc) {
			pr_err("gpio request failed\n");
			return rc;
		}
		gpio_request_done = true;
	}

	if (enable) {
		if (!pinfo->panel_power_on) {
			if (gpio_is_valid(ctrl_pdata->disp_en_gpio))
				gpio_set_value((ctrl_pdata->disp_en_gpio), 1);

@@ -249,11 +245,12 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
				gpio_set_value((ctrl_pdata->rst_gpio),
					pdata->panel_info.rst_seq[i]);
				if (pdata->panel_info.rst_seq[++i])
				usleep(pdata->panel_info.rst_seq[i] * 1000);
					usleep(pinfo->rst_seq[i] * 1000);
			}

			if (gpio_is_valid(ctrl_pdata->bklt_en_gpio))
				gpio_set_value((ctrl_pdata->bklt_en_gpio), 1);
		}

		if (gpio_is_valid(ctrl_pdata->mode_gpio)) {
			if (pinfo->mode_gpio_state == MODE_GPIO_HIGH)
@@ -280,7 +277,6 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
		gpio_free(ctrl_pdata->rst_gpio);
		if (gpio_is_valid(ctrl_pdata->mode_gpio))
			gpio_free(ctrl_pdata->mode_gpio);
		gpio_request_done = false;
	}
	return rc;
}