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

Commit b0392e0c authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

regulator: cpr-regulator: Add a DT property for min. quotient difference



There are targets where the minimum target quotient difference between the
highest and (highest - 1) fuse corner may be lower than 50. Add an optional
property to allow passing this value as platform data. If the property
is not present use a default value of 50.

Change-Id: I72901d82743e6fb0915a7e53cefbd4861d0ca3db
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent fa6d1e8f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -511,6 +511,9 @@ Optional properties:
				greater than all of the real row numbers addressed in other properties of
				the cpr-regulator device node.  This property is required if
				qcom,fuse-remap-source is specified.
- qcom,cpr-quot-min-diff:	Integer which defines the minimum target-quotient difference between
				the highest and (highest - 1) fuse corner to keep CPR enabled. If this
				property is not specified a default value of 50 is used.

Example:
	apc_vreg_corner: regulator@f9018000 {
+6 −1
Original line number Diff line number Diff line
@@ -2882,12 +2882,17 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev,
		 */
		int *quot = cpr_vreg->cpr_fuse_target_quot;
		int highest_fuse_corner = cpr_vreg->num_fuse_corners;
		u32 min_diff_quot;
		bool valid_fuse = true;

		min_diff_quot = CPR_FUSE_MIN_QUOT_DIFF;
		of_property_read_u32(of_node, "qcom,cpr-quot-min-diff",
							&min_diff_quot);

		if (quot[highest_fuse_corner] > quot[highest_fuse_corner - 1]) {
			if ((quot[highest_fuse_corner]
				- quot[highest_fuse_corner - 1])
					<= CPR_FUSE_MIN_QUOT_DIFF)
					<= min_diff_quot)
				valid_fuse = false;
		} else {
			valid_fuse = false;