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

Commit 3a685770 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Matt Wagantall
Browse files

ARM: dts: msm: add DSI PHY regulators to MDSS DSI node



Currently, we turn off the DSI ctrl/PHY regulators during suspend as
part of panel power control API which might cause the regulators to be
turned off before the DSI controller and PHY is disabled. Hence, add the
DSI PHY regulators to the MDSS DSI node for multiple chipsets and control
these regulators as part of DSI clock control API.

Change-Id: I134ad45155605db049088efb5d819e142bafdc12
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent 958c041d
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
@@ -35,10 +35,12 @@ Optional properties:
- qcom,platform-bist-ctrl:		An array of length 6 that specifies the PHY
					BIST ctrl settings.
- vcca-supply:				Phandle for vcca regulator device node.
- qcom,ctrl-supply-entries:		A node that lists the elements of the supply used by the
					DSI controller and PHY. There can be more than one instance
					of this binding, in which case the entry would be appended
					with the supply entry index.
- qcom,<type>-supply-entries:		A node that lists the elements of the supply used by the
					a particular "type" of DSI modulee. The module "types"
					can be "core", "ctrl", and "phy". Within the same type,
					there can be more than one instance of this binding,
					in which case the entry would be appended with the
					supply entry index.
					e.g. qcom,ctrl-supply-entry@0
					-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
					-- qcom,supply-min-voltage: minimum voltage level (uV)
@@ -49,12 +51,6 @@ Optional properties:
					-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
					-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
					-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
- qcom,core-supply-entries:		A node that lists the elements of the supply used to
					power the DSI core. There can be more than one instance
					of this binding, in which case the entry would be appended
					with the supply entry index. For a detailed description of
					fields in the supply entry, refer to the qcom,ctrl-supply-entries
					binding above.
- qcom,platform-enable-gpio:		Specifies the panel lcd/display enable gpio.
- qcom,platform-reset-gpio:		Specifies the panel reset gpio.
- qcom,platform-te-gpio:		Specifies the gpio used for TE.
@@ -133,6 +129,24 @@ Example:
			};
		};

		qcom,phy-supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;

			qcom,phy-supply-entry@0 {
				reg = <0>;
				qcom,supply-name = "vddio";
				qcom,supply-min-voltage = <1800000>;
				qcom,supply-max-voltage = <1800000>;
				qcom,supply-enable-load = <100000>;
				qcom,supply-disable-load = <100>;
				qcom,supply-pre-on-sleep = <0>;
				qcom,supply-post-on-sleep = <20>;
				qcom,supply-pre-off-sleep = <0>;
				qcom,supply-post-off-sleep = <0>;
			};
		};

		qcom,ctrl-supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;
+13 −3
Original line number Diff line number Diff line
@@ -335,9 +335,14 @@
				qcom,supply-enable-load = <18160>;
				qcom,supply-disable-load = <1>;
			};
		};

			qcom,ctrl-supply-entry@1 {
				reg = <2>;
		qcom,phy-supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;

			qcom,phy-supply-entry@0 {
				reg = <0>;
				qcom,supply-name = "vcca";
				qcom,supply-min-voltage = <925000>;
				qcom,supply-max-voltage = <925000>;
@@ -420,8 +425,13 @@
				qcom,supply-enable-load = <18160>;
				qcom,supply-disable-load = <1>;
			};
		};

		qcom,phy-supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;

			qcom,ctrl-supply-entry@1 {
			qcom,phy-supply-entry@0 {
				reg = <2>;
				qcom,supply-name = "vcca";
				qcom,supply-min-voltage = <925000>;
+14 −40
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
{
	int ret = 0;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	int i = 0;

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
@@ -183,20 +182,12 @@ static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
		udelay(2000);
	}

	for (i = DSI_MAX_PM - 1; i >= 0; i--) {
		/*
		 * Core power module will be disabled when the
		 * clocks are disabled
		 */
		if (DSI_CORE_PM == i)
			continue;
	ret = msm_dss_enable_vreg(
			ctrl_pdata->power_data[i].vreg_config,
			ctrl_pdata->power_data[i].num_vreg, 0);
		ctrl_pdata->power_data[DSI_PANEL_PM].vreg_config,
		ctrl_pdata->power_data[DSI_PANEL_PM].num_vreg, 0);
	if (ret)
		pr_err("%s: failed to disable vregs for %s\n",
				__func__, __mdss_dsi_pm_name(i));
	}
			__func__, __mdss_dsi_pm_name(DSI_PANEL_PM));

end:
	return ret;
@@ -206,7 +197,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
{
	int ret = 0;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	int i = 0;

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
@@ -216,22 +206,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);

	for (i = 0; i < DSI_MAX_PM; i++) {
		/*
		 * Core power module will be enabled when the
		 * clocks are enabled
		 */
		if (DSI_CORE_PM == i)
			continue;
	ret = msm_dss_enable_vreg(
			ctrl_pdata->power_data[i].vreg_config,
			ctrl_pdata->power_data[i].num_vreg, 1);
		ctrl_pdata->power_data[DSI_PANEL_PM].vreg_config,
		ctrl_pdata->power_data[DSI_PANEL_PM].num_vreg, 1);
	if (ret) {
		pr_err("%s: failed to enable vregs for %s\n",
				__func__, __mdss_dsi_pm_name(i));
			goto error;
		}
			__func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
		return ret;
	}

	if (ctrl_pdata->panel_bias_vreg) {
		pr_debug("%s: Enable panel bias vreg. ndx = %d\n",
		       __func__, ctrl_pdata->ndx);
@@ -241,8 +224,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
		udelay(2000);
	}

	i--;

	/*
	 * If continuous splash screen feature is enabled, then we need to
	 * request all the GPIOs that have already been configured in the
@@ -260,13 +241,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
					__func__, ret);
	}

error:
	if (ret) {
		for (; i >= 0; i--)
			msm_dss_enable_vreg(
				ctrl_pdata->power_data[i].vreg_config,
				ctrl_pdata->power_data[i].num_vreg, 0);
	}
	return ret;
}

+3 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ enum dsi_lane_map_type {
enum dsi_pm_type {
	DSI_CORE_PM,
	DSI_CTRL_PM,
	DSI_PHY_PM,
	DSI_PANEL_PM,
	DSI_MAX_PM
};
@@ -520,6 +521,7 @@ static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
	switch (module) {
	case DSI_CORE_PM:	return "DSI_CORE_PM";
	case DSI_CTRL_PM:	return "DSI_CTRL_PM";
	case DSI_PHY_PM:	return "DSI_PHY_PM";
	case DSI_PANEL_PM:	return "PANEL_PM";
	default:		return "???";
	}
@@ -531,6 +533,7 @@ static inline const char *__mdss_dsi_pm_supply_node_name(
	switch (module) {
	case DSI_CORE_PM:	return "qcom,core-supply-entries";
	case DSI_CTRL_PM:	return "qcom,ctrl-supply-entries";
	case DSI_PHY_PM:	return "qcom,phy-supply-entries";
	case DSI_PANEL_PM:	return "qcom,panel-supply-entries";
	default:		return "???";
	}
+60 −29
Original line number Diff line number Diff line
@@ -1449,6 +1449,7 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
	int enable)
{
	int rc = 0;
	int i = 0;
	struct mdss_panel_data *pdata = NULL;

	if (!ctrl) {
@@ -1464,17 +1465,32 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,

	if (enable) {
		if (!ctrl->core_power) {
			/* enable mdss gdsc */
			pr_debug("%s: Enable MDP FS\n", __func__);
			/*
			 *              Enable DSI core power
			 * 1.> PANEL_PM are controlled as part of
			 *     panel_power_ctrl. Needed not be handled here.
			 * 2.> PHY_PM and CTRL_PM need to be enabled/disabled
			 *     only during unblank/blank. Their state should
			 *     not be changed during static screen.
			 */
			pr_debug("%s: Enable DSI core power\n", __func__);
			for (i = 0; i < DSI_MAX_PM; i++) {
				if ((DSI_PANEL_PM == i) ||
					((DSI_CORE_PM != i) &&
					(pdata->panel_info.blank_state !=
					MDSS_PANEL_BLANK_BLANK) &&
					!pdata->panel_info.cont_splash_enabled))
					continue;
				rc = msm_dss_enable_vreg(
				ctrl->power_data[DSI_CORE_PM].vreg_config,
				ctrl->power_data[DSI_CORE_PM].num_vreg, 1);
					ctrl->power_data[i].vreg_config,
					ctrl->power_data[i].num_vreg, 1);
				if (rc) {
					pr_err("%s: failed to enable vregs for %s\n",
						__func__,
					__mdss_dsi_pm_name(DSI_CORE_PM));
						__mdss_dsi_pm_name(i));
					goto error;
				}
			}
			ctrl->core_power = true;
		}

@@ -1559,35 +1575,50 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
		 */
		mdss_dsi_bus_clk_stop(ctrl);

		/* disable mdss gdsc only if dsi phy was successfully clamped*/
		/* disable DSI core power if dsi phy was successfully clamped */
		if (rc) {
			pr_debug("%s: leaving mdss gdsc on\n", __func__);
			pr_debug("%s: leaving DSI core power on\n", __func__);
		} else {
			pr_debug("%s: Disable MDP FS\n", __func__);
			pr_debug("%s: Disable DSI core power\n", __func__);
			for (i = DSI_MAX_PM - 1; i >= 0; i--) {
				if ((DSI_PANEL_PM == i) ||
					((DSI_CORE_PM != i) &&
					(pdata->panel_info.blank_state !=
						MDSS_PANEL_BLANK_BLANK)))
					continue;
				rc = msm_dss_enable_vreg(
				ctrl->power_data[DSI_CORE_PM].vreg_config,
				ctrl->power_data[DSI_CORE_PM].num_vreg, 0);
					ctrl->power_data[i].vreg_config,
					ctrl->power_data[i].num_vreg, 0);
				if (rc) {
					pr_warn("%s: failed to disable vregs for %s\n",
						__func__,
					__mdss_dsi_pm_name(DSI_CORE_PM));
						__mdss_dsi_pm_name(i));
					rc = 0;
				} else {
					ctrl->core_power = false;
				}
			}
		}
	}
	return rc;

error_ulps:
	mdss_dsi_bus_clk_stop(ctrl);
error_bus_clk_start:
	if (msm_dss_enable_vreg(ctrl->power_data[DSI_CORE_PM].vreg_config,
		ctrl->power_data[DSI_CORE_PM].num_vreg, 0))
	for (i = DSI_MAX_PM - 1; i >= 0; i--) {
		if ((DSI_PANEL_PM == i) || ((DSI_CORE_PM != i) &&
			(pdata->panel_info.blank_state !=
			MDSS_PANEL_BLANK_BLANK)))
			continue;
		rc = msm_dss_enable_vreg(ctrl->power_data[i].vreg_config,
			ctrl->power_data[i].num_vreg, 0);
		if (rc) {
			pr_warn("%s: failed to disable vregs for %s\n",
			__func__, __mdss_dsi_pm_name(DSI_CORE_PM));
	else
				__func__, __mdss_dsi_pm_name(i));
		} else {
			ctrl->core_power = false;
		}
	}
error:
	return rc;
}