diff mbox

[U-Boot] power: pmic: tps65218: Fix tps65218_voltage_update function

Message ID 1495706725-5988-1-git-send-email-j-keerthy@ti.com
State Accepted
Delegated to: Jaehoon Chung
Headers show

Commit Message

Keerthy May 25, 2017, 10:05 a.m. UTC
Currently while setting the vsel value for dcdc1 and dcdc2
the driver is wrongly masking the entire 8 bits in the process
clearing PFM (bit7) field as well. Hence describe an appropriate
mask for vsel field and modify only those bits in the vsel
mask.

Source: http://www.ti.com/lit/ds/symlink/tps65218.pdf

Signed-off-by: Keerthy <j-keerthy@ti.com>
Fixes: 86db550b38 ("power: Add support for the TPS65218 PMIC")
---
 drivers/power/pmic/pmic_tps65218.c | 2 +-
 include/power/tps65218.h           | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini May 26, 2017, 6:17 p.m. UTC | #1
On Thu, May 25, 2017 at 03:35:25PM +0530, Keerthy wrote:

> Currently while setting the vsel value for dcdc1 and dcdc2
> the driver is wrongly masking the entire 8 bits in the process
> clearing PFM (bit7) field as well. Hence describe an appropriate
> mask for vsel field and modify only those bits in the vsel
> mask.
> 
> Source: http://www.ti.com/lit/ds/symlink/tps65218.pdf
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Fixes: 86db550b38 ("power: Add support for the TPS65218 PMIC")

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/drivers/power/pmic/pmic_tps65218.c b/drivers/power/pmic/pmic_tps65218.c
index f32fa40..c5e768a 100644
--- a/drivers/power/pmic/pmic_tps65218.c
+++ b/drivers/power/pmic/pmic_tps65218.c
@@ -101,7 +101,7 @@  int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel)
 
 	/* set voltage level */
 	if (tps65218_reg_write(TPS65218_PROT_LEVEL_2, dc_cntrl_reg, volt_sel,
-			       TPS65218_MASK_ALL_BITS))
+			       TPS65218_DCDC_VSEL_MASK))
 		return 1;
 
 	/* set GO bit to initiate voltage transition */
diff --git a/include/power/tps65218.h b/include/power/tps65218.h
index 4d68faa..e3538e2 100644
--- a/include/power/tps65218.h
+++ b/include/power/tps65218.h
@@ -56,6 +56,8 @@  enum {
 
 #define TPS65218_MASK_ALL_BITS			0xFF
 
+#define TPS65218_DCDC_VSEL_MASK			0x3F
+
 #define TPS65218_DCDC_VOLT_SEL_0950MV		0x0a
 #define TPS65218_DCDC_VOLT_SEL_1100MV		0x19
 #define TPS65218_DCDC_VOLT_SEL_1200MV		0x23