mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-01 11:36:49 +07:00
58fa6ab42c
Currently we have a special code in tps80031_ldo_set_voltage_sel() to handle LDO2 track mode for TPS80031 or TPS80032-ES1.0. The purpose is to address below issues: Issue description: - LDO2 traking mode is enabled - LDO2 tracks SMPS2 voltage. - LDO2 automatically switch-off when LDO2_CFG_VOLTAGE is changed to some discrete values (non exhaustive list): 00011001, 00011010, 00011011, 00011100, . - LDO2 switch-on again when LDO2_CFG_VOLTAGE is changed to other values (non exhaustive list): 00011000, 00010111, . LDOs have reserved codes. For these codes, LDO is switch-off. In tracking, LDO2 ref comes from SMPS2. However LDO2 enable is still gated by LDO2 VSEL decoding. As a result, in tracking mode LDO2 will be disabled for following code (SMPS VSEL format): 000000 & 100000 (MSB not decoded) 011001 & 111001 (MSB not decoded) 011010 & 111010 (MSB not decoded) 011100 & 111100 (MSB not decoded) 011101 & 111101 (MSB not decoded) 011110 & 111110 (MSB not decoded) However, current code has below bugs: 1. It uses regulator_list_voltage_linear, so list_voltage() still shows above invalid selectors have supported voltage. 2. Current code may return -EINVAL in tps80031_ldo_set_voltage_sel() for supported voltage. This is because when we use regulator_list_voltage_linear as list_voltage callback, regulator core will default use regulator_map_voltage_linear(). regulator_map_voltage_linear() has an assumption that the voltages are linear which is not true for this case. For example, when request voltage range is: min_uV=950000 uV && max_uV=1200000 uV regulator_map_voltage_linear() returns the selector is 29 (0x1D), set_voltage_sel() returns -EINVAL. (The selector is in invalid range, 0x19 ~ 0x1f). In above case, map_voltage() should find the lowest valid voltage within specific range (selector = 0x20) and set_voltage_sel() should successfully set the voltage to 987500 uV. This patch fixes these issues by: 1. Add checking valid setting for LDO2 track mode of TPS80031 or TPS80032-ES1.0 in list_voltage. So it returns -EINVAL for invalid selectors. 2. Implement tps80031_ldo_map_voltage, use regulator_map_voltage_iterate() to find the lowest voltage within specific range for TPS80031 or TPS80032-ES1.0. This is required when the voltage map is no longer linear. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> |
||
---|---|---|
.. | ||
88pm8607.c | ||
aat2870-regulator.c | ||
ab3100.c | ||
ab8500.c | ||
ad5398.c | ||
anatop-regulator.c | ||
arizona-ldo1.c | ||
arizona-micsupp.c | ||
as3711-regulator.c | ||
core.c | ||
da903x.c | ||
da9052-regulator.c | ||
da9055-regulator.c | ||
db8500-prcmu.c | ||
dbx500-prcmu.c | ||
dbx500-prcmu.h | ||
dummy.c | ||
dummy.h | ||
fan53555.c | ||
fixed-helper.c | ||
fixed.c | ||
gpio-regulator.c | ||
isl6271a-regulator.c | ||
Kconfig | ||
lp872x.c | ||
lp3971.c | ||
lp3972.c | ||
lp8755.c | ||
lp8788-buck.c | ||
lp8788-ldo.c | ||
Makefile | ||
max1586.c | ||
max8649.c | ||
max8660.c | ||
max8907-regulator.c | ||
max8925-regulator.c | ||
max8952.c | ||
max8973-regulator.c | ||
max8997.c | ||
max8998.c | ||
max77686.c | ||
mc13xxx-regulator-core.c | ||
mc13xxx.h | ||
mc13783-regulator.c | ||
mc13892-regulator.c | ||
of_regulator.c | ||
palmas-regulator.c | ||
pcap-regulator.c | ||
pcf50633-regulator.c | ||
rc5t583-regulator.c | ||
s2mps11.c | ||
s5m8767.c | ||
tps6105x-regulator.c | ||
tps6507x-regulator.c | ||
tps6524x-regulator.c | ||
tps6586x-regulator.c | ||
tps51632-regulator.c | ||
tps62360-regulator.c | ||
tps65023-regulator.c | ||
tps65090-regulator.c | ||
tps65217-regulator.c | ||
tps65910-regulator.c | ||
tps65912-regulator.c | ||
tps80031-regulator.c | ||
twl-regulator.c | ||
userspace-consumer.c | ||
vexpress.c | ||
virtual.c | ||
wm831x-dcdc.c | ||
wm831x-isink.c | ||
wm831x-ldo.c | ||
wm8350-regulator.c | ||
wm8400-regulator.c | ||
wm8994-regulator.c |