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

Commit 8d5254a3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "regulator: cpr-regulator: add support for target quotient fuse size"

parents d2f1413d e3d80caa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -157,6 +157,13 @@ Optional properties:
					is present, and vise versa.
- qcom,cpr-fuse-bp-cpr-disable:	Bit position of the bit to indicate if CPR should be disabled
- qcom,cpr-fuse-bp-scheme:     Bit position of the bit to indicate if it's a global/local scheme
- qcom,cpr-fuse-target-quot-size:	Array of bit size in the CPR fuse for the target quotient of all corners.
					The elements with index[0..2] are:
					  [0] => bit size of the SVS target quotient
					  [1] => bit size of the NOMINAL target quotient
					  [2] => bit size of the TURBO target quotient
					If this property is not present, then all target quotient fuse values
					are assumed to be the default length of 12 bits.
- qcom,cpr-enable:		Present: CPR enabled by default.
				Not Present: CPR disable by default.
- qcom,cpr-fuse-cond-min-volt-sel:	Array of 5 elements to indicate where to read the bits,  what value to
@@ -351,6 +358,7 @@ Example:
		qcom,cpr-fuse-bp-cpr-disable = <36>;
		qcom,cpr-fuse-bp-scheme = <37>;
		qcom,cpr-fuse-target-quot = <24 12 0>;
		qcom,cpr-fuse-target-quot-size = <12 12 12>;
		qcom,cpr-fuse-ro-sel = <54 38 41>;
		qcom,cpr-fuse-redun-sel = <138 57 1 1 1>;
		qcom,cpr-fuse-redun-row = <139 1>;
+18 −1
Original line number Diff line number Diff line
@@ -1705,6 +1705,11 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
	u32 ro_sel, val;
	u64 fuse_bits, fuse_bits_2;
	u32 quot_adjust[CPR_FUSE_CORNER_MAX];
	u32 target_quot_size[CPR_FUSE_CORNER_MAX] = {
		[CPR_FUSE_CORNER_SVS]		= CPR_FUSE_TARGET_QUOT_BITS,
		[CPR_FUSE_CORNER_NORMAL]	= CPR_FUSE_TARGET_QUOT_BITS,
		[CPR_FUSE_CORNER_TURBO]		= CPR_FUSE_TARGET_QUOT_BITS,
	};

	if (of_find_property(of_node, "qcom,cpr-fuse-redun-sel", NULL)) {
		rc = of_property_read_u32_array(of_node,
@@ -1743,6 +1748,18 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
		return rc;
	}

	if (of_property_read_bool(of_node, "qcom,cpr-fuse-target-quot-size")) {
		rc = of_property_read_u32_array(of_node,
			"qcom,cpr-fuse-target-quot-size",
			&target_quot_size[CPR_FUSE_CORNER_SVS],
			CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
		if (rc < 0) {
			pr_err("error while reading qcom,cpr-fuse-target-quot-size: rc=%d\n",
				rc);
			return rc;
		}
	}

	rc = of_property_read_u32_array(of_node,
		ro_sel_str,
		&bp_ro_sel[CPR_FUSE_CORNER_SVS],
@@ -1842,7 +1859,7 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
		ro_sel = (fuse_bits >> bp_ro_sel[i])
				& CPR_FUSE_RO_SEL_BITS_MASK;
		val = (fuse_bits >> bp_target_quot[i])
				& CPR_FUSE_TARGET_QUOT_BITS_MASK;
				& ((1 << target_quot_size[i]) - 1);
		cpr_vreg->cpr_fuse_target_quot[i] = val;
		cpr_vreg->cpr_fuse_ro_sel[i] = ro_sel;
		pr_info("Corner[%d]: ro_sel = %d, target quot = %d\n",