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

Commit 027d9b37 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: make CPR scheme fuse checking optional"

parents 9bdfd7ad 1721e37c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ Required properties:
				 [0] => the fuse row number
				 [1] => fuse reading method, 0 for direct reading or 1 for SCM reading
- qcom,cpr-fuse-bp-cpr-disable:	Bit position of the bit to indicate if CPR should be disable
- qcom,cpr-fuse-bp-scheme:	Bit position of the bit to indicate if it's a global/local scheme
- qcom,cpr-fuse-target-quot:	Array of bit positions in fuse for Target Quotient of all corners.
				It should have index and value like this:
				  [0] => bit position of the LSB bit for SVS target quotient
@@ -157,6 +156,7 @@ Optional properties:
- qcom,cpr-fuse-redun-bp-scheme:	Redundant bit position of the bit to indicate if it's a global/local scheme
					This property is required if cpr-fuse-redun-bp-cpr-disable
					is present, and vise versa.
- qcom,cpr-fuse-bp-scheme:     Bit position of the bit to indicate if it's a global/local scheme
- 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
+32 −12
Original line number Diff line number Diff line
@@ -1666,7 +1666,7 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
{
	struct device_node *of_node = pdev->dev.of_node;
	int i, rc = 0;
	bool redundant = false;
	bool redundant = false, scheme_fuse_valid = false;
	u32 cpr_fuse_redun_sel[5];
	char *targ_quot_str, *ro_sel_str;
	u32 cpr_fuse_row[2];
@@ -1734,9 +1734,14 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
			CPR_PROP_READ_U32(of_node,
					  "cpr-fuse-redun-bp-cpr-disable",
					  &bp_cpr_disable, rc);
			if (of_find_property(of_node,
					"qcom,cpr-fuse-redun-bp-scheme",
					NULL)) {
				CPR_PROP_READ_U32(of_node,
						"cpr-fuse-redun-bp-scheme",
						&bp_scheme, rc);
				scheme_fuse_valid = true;
			}
			if (rc)
				return rc;
			fuse_bits_2 = fuse_bits;
@@ -1746,8 +1751,14 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
			/* Use original fuse if no optional property */
			CPR_PROP_READ_U32(of_node, "cpr-fuse-bp-cpr-disable",
					  &bp_cpr_disable, rc);
			CPR_PROP_READ_U32(of_node, "cpr-fuse-bp-scheme",
			if (of_find_property(of_node,
					"qcom,cpr-fuse-bp-scheme",
					NULL)) {
				CPR_PROP_READ_U32(of_node,
						"cpr-fuse-bp-scheme",
						&bp_scheme, rc);
				scheme_fuse_valid = true;
			}
			rc = of_property_read_u32_array(of_node,
					"qcom,cpr-fuse-row",
					temp_row, 2);
@@ -1762,18 +1773,27 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
	} else {
		CPR_PROP_READ_U32(of_node, "cpr-fuse-bp-cpr-disable",
				  &bp_cpr_disable, rc);
		if (of_find_property(of_node, "qcom,cpr-fuse-bp-scheme",
							NULL)) {
			CPR_PROP_READ_U32(of_node, "cpr-fuse-bp-scheme",
					&bp_scheme, rc);
			scheme_fuse_valid = true;
		}
		if (rc)
			return rc;
		fuse_bits_2 = fuse_bits;
	}

	cpr_vreg->cpr_fuse_disable = (fuse_bits_2 >> bp_cpr_disable) & 0x01;
	if (scheme_fuse_valid) {
		cpr_vreg->cpr_fuse_local = (fuse_bits_2 >> bp_scheme) & 0x01;

		pr_info("disable = %d, local = %d\n",
		cpr_vreg->cpr_fuse_disable, cpr_vreg->cpr_fuse_local);
				cpr_vreg->cpr_fuse_disable,
				cpr_vreg->cpr_fuse_local);
	} else {
		cpr_vreg->cpr_fuse_local = true;
		pr_info("disable = %d\n", cpr_vreg->cpr_fuse_disable);
	}

	for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++) {
		ro_sel = (fuse_bits >> bp_ro_sel[i])