Commit fff45ce7e753cece9e205d2d32ec7deb1db743b8

Authored by Keerthy
Committed by Lokesh Vutla
1 parent 6f3f23b509

power: pmic: tps65218: Fix tps65218_voltage_update function

commit 6183b29559107650cb38f905e069a93ff9da1d7d upstream

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>

Showing 2 changed files with 3 additions and 1 deletions Side-by-side Diff

drivers/power/pmic/pmic_tps65218.c
... ... @@ -102,7 +102,7 @@
102 102  
103 103 /* set voltage level */
104 104 if (tps65218_reg_write(TPS65218_PROT_LEVEL_2, dc_cntrl_reg, volt_sel,
105   - TPS65218_MASK_ALL_BITS))
  105 + TPS65218_DCDC_VSEL_MASK))
106 106 return 1;
107 107  
108 108 /* set GO bit to initiate voltage transition */
include/power/tps65218.h
... ... @@ -56,6 +56,8 @@
56 56  
57 57 #define TPS65218_MASK_ALL_BITS 0xFF
58 58  
  59 +#define TPS65218_DCDC_VSEL_MASK 0x3F
  60 +
59 61 #define TPS65218_DCDC_VOLT_SEL_0950MV 0x0a
60 62 #define TPS65218_DCDC_VOLT_SEL_1100MV 0x19
61 63 #define TPS65218_DCDC_VOLT_SEL_1200MV 0x23