power: pmic: tps65218: Fix tps65218_voltage_update function
authorKeerthy <j-keerthy@ti.com>
Wed, 24 May 2017 04:49:27 +0000 (10:19 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 29 May 2017 08:28:52 +0000 (17:28 +0900)
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: Jaehoon Chung <jh80.chung@samsung.com>
drivers/power/pmic/pmic_tps65218.c
include/power/tps65218.h

index f32fa40863880a5c9e6571bc6eb7a0935061a180..c5e768ae4b63df18f26d9a9cfae753904b9a163f 100644 (file)
@@ -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 */
index 4d68faacafd3bad5d04d1468b04462f7b96683f9..e3538e21f04c361a9f79409e8c88c02c2117b615 100644 (file)
@@ -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