Commit d4db69eb authored by Peter Geis's avatar Peter Geis Committed by Mark Brown

regulator: fan53555: fix TCS4525 voltage calulation

The TCS4525 has 128 voltage steps. With the calculation set to 127 the
most significant bit is disregarded which leads to a miscalculation of
the voltage by about 200mv.

Fix the calculation to end deadlock on the rk3566-quartz64 which uses
this as the cpu regulator.

Fixes: 914df8fa ("regulator: fan53555: Add TCS4525 DCDC support")
Signed-off-by: default avatarPeter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210511211335.2935163-2-pgwipeout@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d019f38a
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#define FAN53555_NVOLTAGES 64 /* Numbers of voltages */ #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
#define FAN53526_NVOLTAGES 128 #define FAN53526_NVOLTAGES 128
#define TCS4525_NVOLTAGES 127 /* Numbers of voltages */
#define TCS_VSEL_NSEL_MASK 0x7f #define TCS_VSEL_NSEL_MASK 0x7f
#define TCS_VSEL0_MODE (1 << 7) #define TCS_VSEL0_MODE (1 << 7)
...@@ -376,7 +375,7 @@ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di) ...@@ -376,7 +375,7 @@ static int fan53555_voltages_setup_tcs(struct fan53555_device_info *di)
/* Init voltage range and step */ /* Init voltage range and step */
di->vsel_min = 600000; di->vsel_min = 600000;
di->vsel_step = 6250; di->vsel_step = 6250;
di->vsel_count = TCS4525_NVOLTAGES; di->vsel_count = FAN53526_NVOLTAGES;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment