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

Commit d5b53d6c authored by Kiran Gunda's avatar Kiran Gunda Committed by Gerrit - the friendly Code Review server
Browse files

regulator: qcom_pm8008: Fix regulator_get_voltage API



Currently the LDO voltage is read from "VSET_VALID_LB" and
"VSET_VALID_UB" registers which provides the actual voltage
when the LDO is enabled. However, these registers return a
value "0" when the LDO is disabled. Due to this the incorrect
voltage is set on the parent buck which leads to voltage
ripples. Fix it by reading VSET_LB and VSET_UB registers
which return a valid voltage even though the LDO is disabled.

Change-Id: Id47882802a1d39f7843a40853edfc4f6d17376f5
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent f2be2c18
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -53,8 +53,6 @@


#define LDO_VSET_LB_REG(base)		(base + 0x40)
#define LDO_VSET_LB_REG(base)		(base + 0x40)


#define LDO_VSET_VALID_LB_REG(base)	(base + 0x42)

#define LDO_MODE_CTL1_REG(base)		(base + 0x45)
#define LDO_MODE_CTL1_REG(base)		(base + 0x45)
#define MODE_PRIMARY_MASK		GENMASK(2, 0)
#define MODE_PRIMARY_MASK		GENMASK(2, 0)
#define LDO_MODE_NPM			7
#define LDO_MODE_NPM			7
@@ -156,7 +154,7 @@ static int pm8008_regulator_get_voltage(struct regulator_dev *rdev)
	int rc;
	int rc;


	rc = pm8008_read(pm8008_reg->regmap,
	rc = pm8008_read(pm8008_reg->regmap,
			LDO_VSET_VALID_LB_REG(pm8008_reg->base),
			LDO_VSET_LB_REG(pm8008_reg->base),
			vset_raw, 2);
			vset_raw, 2);
	if (rc < 0) {
	if (rc < 0) {
		pm8008_err(pm8008_reg,
		pm8008_err(pm8008_reg,