[PATCH RFT] regulator: palmas: Remove wrong voltage setting forenabling LDO8 tracking mode

From: Axel Lin
Date: Thu Apr 18 2013 - 23:15:18 EST


When SMPS45 is set to off and LDO8 tracking is enabled, LDO8 output can be set
from 0.45 to 1.65V and the steps of voltage change is 25mV.

This is done by setting:
pmic->desc[id].min_uV = 450000;
pmic->desc[id].uV_step = 25000;

I don't see the point of reading vsel register, multiple the register value by
2 and then write back to the register.

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
---
Hi Laxman,

Current code looks strange (and wrong) to me.
I don't see the point of reading vsel register, multiple the register value by
2 and then write back to the register.
Can you double check this patch, in case I might misunderstand the code.

Thanks,
Axel

drivers/regulator/palmas-regulator.c | 18 ------------------
1 file changed, 18 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 67ed5e5d..f26344e 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -643,24 +643,6 @@ static void palmas_enable_ldo8_track(struct palmas *palmas)
dev_err(palmas->dev, "Error in enabling tracking mode\n");
return;
}
- /*
- * When SMPS45 is set to off and LDO8 tracking is enabled, the LDO8
- * output is defined by the LDO8_VOLTAGE.VSEL register divided by two,
- * and can be set from 0.45 to 1.65 V.
- */
- addr = palmas_regs_info[PALMAS_REG_LDO8].vsel_addr;
- ret = palmas_ldo_read(palmas, addr, &reg);
- if (ret) {
- dev_err(palmas->dev, "Error in reading ldo8 voltage reg\n");
- return;
- }
-
- reg = (reg << 1) & PALMAS_LDO8_VOLTAGE_VSEL_MASK;
- ret = palmas_ldo_write(palmas, addr, reg);
- if (ret < 0)
- dev_err(palmas->dev, "Error in setting ldo8 voltage reg\n");
-
- return;
}

static struct of_regulator_match palmas_matches[] = {
--
1.7.10.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/