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

Commit 45e82e6b authored by David Collins's avatar David Collins
Browse files

regulator: cpr3-hmss-regulator: define fuse combo to be CPR revision fuse



Define the cpr3-hmss-regulator fuse combo to be equal to the CPR
fusing revision fuse value.  Provide driver support for all
possible revision values (i.e. 0 to 7).  This ensures that device
tree configurations determine the which specific revisions are
allowed.

Change-Id: I4612160d17c33114dd3821f879926570f5dce8e0
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 0bcb4e94
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -154,7 +154,8 @@ HMSS specific properties:
		    the device.  This value is utilized by several other
		    properties.  Supported values are 1 up to the maximum
		    possible for a given regulator type.  For HMSS the maximum
		    supported value is 1.
		    supported value is 8.  These combos correspond to CPR
		    revision fuse values 0 to 7 in order.

- qcom,ldo-headroom-voltage
	Usage:      required if qcom,vdd-threadN-ldo-supply is specified for the
+3 −3
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@

				qcom,cpr-pd-bypass-mask = <0x07>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <1>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <19>;

				qcom,ldo-headroom-voltage = <150000>;
@@ -649,7 +649,7 @@

				qcom,cpr-pd-bypass-mask = <0x18>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <1>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <10>;

				qcom,cpr-corner-fmax-map = <1 2 5 9 10>;
@@ -704,7 +704,7 @@

				qcom,cpr-pd-bypass-mask = <0xe0>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <1>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <18>;

				qcom,ldo-headroom-voltage = <150000>;
+6 −0
Original line number Diff line number Diff line
@@ -63,10 +63,16 @@
};

&apc0_pwrcl_vreg {
	qcom,cpr-fuse-combos = <2>;
	qcom,ldo-max-voltage = <783000>;
};

&apc0_cbf_vreg {
	qcom,cpr-fuse-combos = <2>;
};

&apc1_vreg {
	qcom,cpr-fuse-combos = <2>;
	qcom,ldo-max-voltage = <780000>;
};

+23 −3
Original line number Diff line number Diff line
@@ -74,14 +74,28 @@ struct cpr3_msm8996_hmss_fuses {
/**
 * enum cpr3_msm8996_hmss_fuse_combo - fuse combinations supported by the HMSS
 *			CPR3 controller on MSM8996
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_DEFAULT:	Initial default combination
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV0:	Part with CPR fusing rev == 0
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV1:	Part with CPR fusing rev == 1
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV2:	Part with CPR fusing rev == 2
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV3:	Part with CPR fusing rev == 3
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV4:	Part with CPR fusing rev == 4
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV5:	Part with CPR fusing rev == 5
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV6:	Part with CPR fusing rev == 6
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV7:	Part with CPR fusing rev == 7
 * %CPR3_MSM8996_HMSS_FUSE_COMBO_COUNT:		Defines the number of
 *						combinations supported
 *
 * This list will be expanded as new requirements are added.
 */
enum cpr3_msm8996_hmss_fuse_combo {
	CPR3_MSM8996_HMSS_FUSE_COMBO_DEFAULT = 0,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV0 = 0,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV1 = 1,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV2 = 2,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV3 = 3,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV4 = 4,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV5 = 5,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV6 = 6,
	CPR3_MSM8996_HMSS_FUSE_COMBO_CPR_REV7 = 7,
	CPR3_MSM8996_HMSS_FUSE_COMBO_COUNT
};

@@ -447,11 +461,17 @@ static int cpr3_msm8996_hmss_read_fuse_data(struct cpr3_regulator *vreg)
		}
	}

	vreg->fuse_combo = fuse->cpr_fusing_rev;
	if (vreg->fuse_combo >= CPR3_MSM8996_HMSS_FUSE_COMBO_COUNT) {
		cpr3_err(vreg, "invalid CPR fuse combo = %d found\n",
			vreg->fuse_combo);
		return -EINVAL;
	}

	vreg->speed_bin_fuse	= fuse->speed_bin;
	vreg->cpr_rev_fuse	= fuse->cpr_fusing_rev;
	vreg->fuse_corner_count	= MSM8996_HMSS_FUSE_CORNERS;
	vreg->platform_fuses	= fuse;
	vreg->fuse_combo	= CPR3_MSM8996_HMSS_FUSE_COMBO_DEFAULT;

	return 0;
}