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

Commit ea53c1ea authored by David Collins's avatar David Collins
Browse files

regulator: cpr3-hmss-regulator: use SPEED_BIN in fuse combo selection



Expand the fuse combination specification so that a new set of
fuse combos is used for SPEED_BIN fuse value 1.  Enforce this
mapping:

Fuse combo   SPEED_BIN   CPR_REV
  0 -  7         0        0 - 7
  8 - 15         1        0 - 7

Change-Id: Id15a41bd3e01ab3f14e22f1ce21a5740d102a08e
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent ec971dd4
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -160,8 +160,10 @@ 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 8.  These combos correspond to CPR
		    revision fuse values 0 to 7 in order.
		    supported value is 16.  The first 8 fuse combos correspond
		    to speed bin fuse value 0 along with CPR revision fuse
		    values 0 to 7.  The last 8 fuse combos correspond to speed
		    bin fuse value 1 along with CPR revision fuse values 0 to 7.

- qcom,ldo-headroom-voltage
	Usage:      required if qcom,vdd-threadN-ldo-supply is specified for the
+5 −27
Original line number Diff line number Diff line
@@ -81,33 +81,11 @@ struct cpr3_msm8996_hmss_fuses {
	u64	aging_init_quot_diff;
};

/**
 * enum cpr3_msm8996_hmss_fuse_combo - fuse combinations supported by the HMSS
 *			CPR3 controller on MSM8996
 * %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.
/*
 * Fuse combos 0 -  7 map to CPR fusing revision 0 - 7 with speed bin fuse = 0.
 * Fuse combos 8 - 15 map to CPR fusing revision 0 - 7 with speed bin fuse = 1.
 */
enum cpr3_msm8996_hmss_fuse_combo {
	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
};
#define CPR3_MSM8996_HMSS_FUSE_COMBO_COUNT	16

/*
 * Constants which define the name of each fuse corner.  Note that no actual
@@ -565,7 +543,7 @@ static int cpr3_msm8996_hmss_read_fuse_data(struct cpr3_regulator *vreg)
		}
	}

	vreg->fuse_combo = fuse->cpr_fusing_rev;
	vreg->fuse_combo = fuse->cpr_fusing_rev + 8 * fuse->speed_bin;
	if (vreg->fuse_combo >= CPR3_MSM8996_HMSS_FUSE_COMBO_COUNT) {
		cpr3_err(vreg, "invalid CPR fuse combo = %d found\n",
			vreg->fuse_combo);