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

Commit b48327bc authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: fix to update the configuration for display related GPIOs



After commit dbe80b7c ("ARM: dts: msm:
remove gpio output settings in dsi pinctrl") driver is no longer
defining in the pinctrl the gpios as output high configuration;
so driver now has to explicitly configure gpio output direction.
This change add the settings in the driver to configure the gpio
as output pin, fixing panel issues when booting-up with
continuous splash disabled.

Change-Id: I1ac3c5dd07cff4a30cce9de3c340f071dd84d49a
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 83bf68d2
Loading
Loading
Loading
Loading
+41 −6
Original line number Diff line number Diff line
@@ -313,8 +313,25 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
			return rc;
		}
		if (!pinfo->cont_splash_enabled) {
			if (gpio_is_valid(ctrl_pdata->disp_en_gpio))
				gpio_set_value((ctrl_pdata->disp_en_gpio), 1);
			if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) {
				rc = gpio_direction_output(
					ctrl_pdata->disp_en_gpio, 1);
				if (rc) {
					pr_err("%s: unable to set dir for en gpio\n",
						__func__);
					goto exit;
				}
			}

			if (pdata->panel_info.rst_seq_len) {
				rc = gpio_direction_output(ctrl_pdata->rst_gpio,
					pdata->panel_info.rst_seq[0]);
				if (rc) {
					pr_err("%s: unable to set dir for rst gpio\n",
						__func__);
					goto exit;
				}
			}

			for (i = 0; i < pdata->panel_info.rst_seq_len; ++i) {
				gpio_set_value((ctrl_pdata->rst_gpio),
@@ -323,15 +340,31 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
					usleep_range(pinfo->rst_seq[i] * 1000, 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->bklt_en_gpio)) {
				rc = gpio_direction_output(
					ctrl_pdata->bklt_en_gpio, 1);
				if (rc) {
					pr_err("%s: unable to set dir for bklt gpio\n",
						__func__);
					goto exit;
				}
			}
		}

		if (gpio_is_valid(ctrl_pdata->mode_gpio)) {
			bool out;

			if (pinfo->mode_gpio_state == MODE_GPIO_HIGH)
				gpio_set_value((ctrl_pdata->mode_gpio), 1);
				out = true;
			else if (pinfo->mode_gpio_state == MODE_GPIO_LOW)
				gpio_set_value((ctrl_pdata->mode_gpio), 0);
				out = false;

			rc = gpio_direction_output(ctrl_pdata->mode_gpio, out);
			if (rc) {
				pr_err("%s: unable to set dir for mode gpio\n",
					__func__);
				goto exit;
			}
		}
		if (ctrl_pdata->ctrl_state & CTRL_STATE_PANEL_INIT) {
			pr_debug("%s: Panel Not properly turned OFF\n",
@@ -353,6 +386,8 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
		if (gpio_is_valid(ctrl_pdata->mode_gpio))
			gpio_free(ctrl_pdata->mode_gpio);
	}

exit:
	return rc;
}