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

Commit d8000fe7 authored by Aravind Venkateswaran's avatar Aravind Venkateswaran
Browse files

msm: mdss: update voltage level configuration for CX supply



Read the minimum and the maximum voltage levels for the CX supply
from the device tree and use those values to program the CX supply.
This allows for flexibility in configuring the levels across
multiple targets.

CRs-Fixed: 1053687
Change-Id: Ib704bfa6c6ca9fc3d90ab76a2e4aef02dc48822a
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent 2e45ea72
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -243,6 +243,12 @@ Bus Scaling Data:
Optional properties:
Optional properties:
- batfet-supply :	Phandle for battery FET regulator device node.
- batfet-supply :	Phandle for battery FET regulator device node.
- vdd-cx-supply :	Phandle for vdd CX regulator device node.
- vdd-cx-supply :	Phandle for vdd CX regulator device node.
- vdd-cx-min-uV :	The minimum voltage level in uV for the CX rail
			whenever the display is on. If vdd-cx-supply is
			specified, then this binding is mandatory.
- vdd-cx-max-uV :	The maximum voltage level in uV for the CX rail
			whenever the display is on. If vdd-cx-supply is
			specified, then this binding is mandatory.
- qcom,vbif-settings :	Array with key-value pairs of constant VBIF register
- qcom,vbif-settings :	Array with key-value pairs of constant VBIF register
			settings used to setup MDSS QoS for optimum performance.
			settings used to setup MDSS QoS for optimum performance.
			The key used should be offset from "vbif_phys" register
			The key used should be offset from "vbif_phys" register
+2 −0
Original line number Original line Diff line number Diff line
@@ -277,6 +277,8 @@ struct mdss_data_type {
	struct regulator *fs;
	struct regulator *fs;
	struct regulator *venus;
	struct regulator *venus;
	struct regulator *vdd_cx;
	struct regulator *vdd_cx;
	u32 vdd_cx_min_uv;
	u32 vdd_cx_max_uv;
	bool batfet_required;
	bool batfet_required;
	struct regulator *batfet;
	struct regulator *batfet;
	bool en_svs_high;
	bool en_svs_high;
+22 −4
Original line number Original line Diff line number Diff line
@@ -1703,6 +1703,24 @@ static int mdss_mdp_irq_clk_setup(struct mdss_data_type *mdata)
		pr_debug("unable to get CX reg. rc=%d\n",
		pr_debug("unable to get CX reg. rc=%d\n",
					PTR_RET(mdata->vdd_cx));
					PTR_RET(mdata->vdd_cx));
		mdata->vdd_cx = NULL;
		mdata->vdd_cx = NULL;
	} else {
		/* Parse CX voltage settings */
		ret = of_property_read_u32(mdata->pdev->dev.of_node,
			"vdd-cx-min-uV", &mdata->vdd_cx_min_uv);
		if (ret) {
			pr_err("min uV for vdd-cx not specified. rc=%d\n", ret);
			return ret;
		}

		ret = of_property_read_u32(mdata->pdev->dev.of_node,
			"vdd-cx-max-uV", &mdata->vdd_cx_max_uv);
		if (ret) {
			pr_err("max uV for vdd-cx not specified. rc=%d\n", ret);
			return ret;
		}

		pr_debug("vdd_cx [min_uV, max_uV] = [%d %d]\n",
			mdata->vdd_cx_min_uv, mdata->vdd_cx_max_uv);
	}
	}


	mdata->reg_bus_clt = mdss_reg_bus_vote_client_create("mdp\0");
	mdata->reg_bus_clt = mdss_reg_bus_vote_client_create("mdp\0");
@@ -4744,8 +4762,8 @@ static int mdss_mdp_cx_ctrl(struct mdss_data_type *mdata, int enable)
	if (enable) {
	if (enable) {
		rc = regulator_set_voltage(
		rc = regulator_set_voltage(
				mdata->vdd_cx,
				mdata->vdd_cx,
				RPM_REGULATOR_CORNER_SVS_SOC,
				mdata->vdd_cx_min_uv,
				RPM_REGULATOR_CORNER_SUPER_TURBO);
				mdata->vdd_cx_max_uv);
		if (rc < 0)
		if (rc < 0)
			goto vreg_set_voltage_fail;
			goto vreg_set_voltage_fail;


@@ -4764,8 +4782,8 @@ static int mdss_mdp_cx_ctrl(struct mdss_data_type *mdata, int enable)
		}
		}
		rc = regulator_set_voltage(
		rc = regulator_set_voltage(
				mdata->vdd_cx,
				mdata->vdd_cx,
				RPM_REGULATOR_CORNER_NONE,
				0,
				RPM_REGULATOR_CORNER_SUPER_TURBO);
				mdata->vdd_cx_max_uv);
		if (rc < 0)
		if (rc < 0)
			goto vreg_set_voltage_fail;
			goto vreg_set_voltage_fail;
	}
	}