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

Commit 7226aeac authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti Committed by Nitin Rawat
Browse files

scsi: ufs: Configure Vccq/Vccq2 with supplied load in LPM



Configure the ufs vccq/vccq2 regulator with supplied load instead
of fixed load in LPM mode.

To configure regulator in LPM mode, on some targets explicit load
(<10mA or <30mA) has to be supplied. On other targets, clients need
to set load exactly as 0. On second category of targets, any load
value other than 0, pushes the regulator to NMP mode.

Adding support for reading load value for Vccq regulator from
device tree. If this property is not present, the regulator would
be set with default load (1mA).

Change-Id: Ifef004f2ea4d3612bc8410b82011fbcfc293ea6f
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
parent 197f1cc9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
		vreg->max_uA = 0;
	}

#if defined(CONFIG_SCSI_UFSHCD_QTI)
	snprintf(prop_name, MAX_PROP_SIZE, "%s-min-microamp", name);
	if (of_property_read_u32(np, prop_name, &vreg->min_uA))
		vreg->min_uA = UFS_VREG_LPM_LOAD_UA;
#endif

	if (!strcmp(name, "vcc")) {
		if (of_property_read_bool(np, "vcc-supply-1p8")) {
			vreg->min_uV = UFS_VREG_VCC_1P8_MIN_UV;
+13 −1
Original line number Diff line number Diff line
@@ -7822,12 +7822,24 @@ static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,

	return ret;
}

#if defined(CONFIG_SCSI_UFSHCD_QTI)
static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba,
					 struct ufs_vreg *vreg)
{
	if (!vreg)
		return 0;
	else if (vreg->unused)
		return 0;
	else
		return ufshcd_config_vreg_load(hba->dev, vreg, vreg->min_uA);
}
#else
static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba,
					struct ufs_vreg *vreg)
{
	return ufshcd_config_vreg_load(hba->dev, vreg, UFS_VREG_LPM_LOAD_UA);
}
#endif

static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba,
					 struct ufs_vreg *vreg)