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

Commit 4fcd6893 authored by Narender Ankam's avatar Narender Ankam Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: dsi: parse and control vdd_ext gpio



Parse and control vdd_ext gpio during power_on/off
sequence required for 10" novatek panel on apq8053 FEPv2.

Change-Id: Iab7f99b6f83f6ef69d84e584e8438b23de01a641
Signed-off-by: default avatarNarender Ankam <nankam@codeaurora.org>
parent 6618051a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ Optional properties:
- qcom,platform-bklight-en-gpio-invert:	Invert the gpio used to enable display back-light
- qcom,panel-mode-gpio:			Specifies the GPIO to select video/command/single-port/dual-port
					mode of panel through gpio when it supports these modes.
- qcom,ext-vdd-gpio:			Specifies the GPIO to enable external VDD supply.
- pinctrl-names:			List of names to assign mdss pin states defined in pinctrl device node
					Refer to pinctrl-bindings.txt
- pinctrl-<0..n>:			Lists phandles each pointing to the pin configuration node within a pin
+22 −0
Original line number Diff line number Diff line
@@ -383,6 +383,14 @@ static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
		ret = 0;
	}

	if (gpio_is_valid(ctrl_pdata->vdd_ext_gpio)) {
		ret = gpio_direction_output(
			ctrl_pdata->vdd_ext_gpio, 0);
		if (ret)
			pr_err("%s: unable to set dir for vdd gpio\n",
					__func__);
	}

	if (mdss_dsi_pinctrl_set_state(ctrl_pdata, false))
		pr_debug("reset disable: pinctrl not enabled\n");

@@ -410,6 +418,15 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);

	if (gpio_is_valid(ctrl_pdata->vdd_ext_gpio)) {
		ret = gpio_direction_output(
				ctrl_pdata->vdd_ext_gpio, 1);
		usleep_range(3000, 4000); /* h/w recommended delay */
		if (ret)
			pr_err("%s: unable to set dir for vdd gpio\n",
					__func__);
	}

	ret = msm_mdss_enable_vreg(
		ctrl_pdata->panel_power_data.vreg_config,
		ctrl_pdata->panel_power_data.num_vreg, 1);
@@ -4183,6 +4200,11 @@ static int mdss_dsi_parse_gpio_params(struct platform_device *ctrl_pdev,
			of_property_read_bool(ctrl_pdev->dev.of_node,
				"qcom,platform-bklight-en-gpio-invert");

	ctrl_pdata->vdd_ext_gpio = of_get_named_gpio(ctrl_pdev->dev.of_node,
		"qcom,ext-vdd-gpio", 0);
	if (!gpio_is_valid(ctrl_pdata->vdd_ext_gpio))
		pr_info("%s: ext vdd gpio not specified\n", __func__);

	ctrl_pdata->rst_gpio = of_get_named_gpio(ctrl_pdev->dev.of_node,
			 "qcom,platform-reset-gpio", 0);
	if (!gpio_is_valid(ctrl_pdata->rst_gpio))
+1 −0
Original line number Diff line number Diff line
@@ -435,6 +435,7 @@ struct mdss_dsi_ctrl_pdata {
	int rst_gpio;
	int disp_en_gpio;
	int bklt_en_gpio;
	int vdd_ext_gpio;
	int mode_gpio;
	int intf_mux_gpio;
	bool bklt_en_gpio_invert;
+12 −0
Original line number Diff line number Diff line
@@ -326,6 +326,15 @@ static int mdss_dsi_request_gpios(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
			goto bklt_en_gpio_err;
		}
	}
	if (gpio_is_valid(ctrl_pdata->vdd_ext_gpio)) {
		rc = gpio_request(ctrl_pdata->vdd_ext_gpio,
						"vdd_enable");
		if (rc) {
			pr_err("request vdd enable gpio failed, rc=%d\n",
				rc);
			goto vdd_en_gpio_err;
		}
	}
	if (gpio_is_valid(ctrl_pdata->mode_gpio)) {
		rc = gpio_request(ctrl_pdata->mode_gpio, "panel_mode");
		if (rc) {
@@ -337,6 +346,9 @@ static int mdss_dsi_request_gpios(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	return rc;

mode_gpio_err:
	if (gpio_is_valid(ctrl_pdata->vdd_ext_gpio))
		gpio_free(ctrl_pdata->vdd_ext_gpio);
vdd_en_gpio_err:
	if (gpio_is_valid(ctrl_pdata->bklt_en_gpio))
		gpio_free(ctrl_pdata->bklt_en_gpio);
bklt_en_gpio_err: