linux_dsm_epyc7002/drivers/regulator
Axel Lin 58fa6ab42c regulator: tps80031: Fix LDO2 track mode for TPS80031 or TPS80032-ES1.0
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>
2013-04-23 11:47:37 +01:00
..
88pm8607.c Merge remote-tracking branch 'regulator/topic/of' into regulator-next 2013-02-19 12:42:52 +00:00
aat2870-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
ab3100.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
ab8500.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
ad5398.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
anatop-regulator.c regulator: anatop: improve precision of delay time 2013-02-08 11:15:00 +00:00
arizona-ldo1.c Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-next 2012-12-10 12:42:55 +09:00
arizona-micsupp.c regulator: arizona-micsupp: Enable bypass in default constraints 2013-01-13 21:31:02 +09:00
as3711-regulator.c regulator: as3711: Fix checking if no platform initialization data 2013-02-13 12:56:51 +00:00
core.c Merge remote-tracking branch 'regulator/fix/doc' into tmp 2013-03-05 10:12:39 +08:00
da903x.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
da9052-regulator.c Merge remote-tracking branch 'regulator/topic/of' into regulator-next 2013-02-19 12:42:52 +00:00
da9055-regulator.c Merge remote-tracking branch 'regulator/topic/da9055' into regulator-next 2013-02-19 12:42:33 +00:00
db8500-prcmu.c regulator: db8500-prcmu - remove incorrect __exit markup 2013-03-01 06:04:44 +00:00
dbx500-prcmu.c regulators: db8500: Fix compile failure for drivers/regulator/dbx500-prcmu.c 2013-01-26 15:30:06 +08:00
dbx500-prcmu.h regulators/db8500: split off shared dbx500 code 2012-01-20 12:01:29 +00:00
dummy.c regulator: remove use of __devinit 2012-11-20 10:31:26 +09:00
dummy.h regulator: fix build when CONFIG_REGULATOR_DUMMY=n 2010-10-28 22:40:32 +01:00
fan53555.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
fixed-helper.c regulator: extend the fixed dummy voltage regulator to accept voltage 2012-06-19 23:22:30 +01:00
fixed.c Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
gpio-regulator.c regulator: gpio-regulator: Staticize of_get_gpio_regulator_config() 2013-01-29 00:44:17 +08:00
isl6271a-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
Kconfig Merge remote-tracking branch 'regulator/topic/lp8755' into regulator-next 2013-02-19 12:42:46 +00:00
lp872x.c Merge remote-tracking branch 'regulator/topic/lp872x' into regulator-next 2013-02-19 12:42:39 +00:00
lp3971.c regulator: lp3971: Convert to get_voltage_sel 2012-12-24 16:26:50 +00:00
lp3972.c regulator: lp3972: Convert to get_voltage_sel 2013-01-08 11:07:05 +00:00
lp8755.c regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number 2013-01-27 11:00:25 +08:00
lp8788-buck.c regulator: lp8788-buck: Remove buck[1|2]_vout_addr array 2013-01-17 16:08:08 +09:00
lp8788-ldo.c regulator: lp8788-ldo: Use ldo->en_pin to check if regulator is enabled by external pin 2013-01-07 11:13:08 +00:00
Makefile regulator: lp8755: new driver for LP8755 2012-12-24 16:32:34 +00:00
max1586.c Merge remote-tracking branch 'regulator/topic/max1586' into regulator-next 2012-12-10 12:42:58 +09:00
max8649.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
max8660.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
max8907-regulator.c regulator: Add missing of_node_put() 2013-01-30 18:50:27 +08:00
max8925-regulator.c regulator: Add missing of_node_put() 2013-01-30 18:50:27 +08:00
max8952.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
max8973-regulator.c Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
max8997.c Merge remote-tracking branch 'regulator/topic/of' into regulator-next 2013-02-19 12:42:52 +00:00
max8998.c Merge remote-tracking branch 'regulator/topic/max8998' into regulator-next 2013-02-19 12:42:49 +00:00
max77686.c regulator: max77686: Reuse rdev_get_id() function. 2013-02-14 12:11:04 +00:00
mc13xxx-regulator-core.c regulator: mc13xxx: Use of_get_child_count() 2013-01-31 14:43:32 +08:00
mc13xxx.h regulator: mc13892: sanity check num_regulators parsed vs. registered 2013-01-27 11:22:30 +08:00
mc13783-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
mc13892-regulator.c regulator: mc13892: sanity check num_regulators parsed vs. registered 2013-01-27 11:22:30 +08:00
of_regulator.c regulator: clear state each invocation of of_regulator_match 2013-01-30 10:11:06 +08:00
palmas-regulator.c regulator: palmas: fix number of SMPS voltages 2013-03-01 15:42:04 +08:00
pcap-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
pcf50633-regulator.c Merge remote-tracking branch 'regulator/topic/min' into regulator-next 2012-12-10 12:43:00 +09:00
rc5t583-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
s2mps11.c regulator: s2mps11: fix incorrect register for buck10 2013-01-31 14:45:11 +08:00
s5m8767.c regulator: s5m8767: Prevent possible NULL pointer dereference 2013-02-13 12:52:19 +00:00
tps6105x-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps6507x-regulator.c regulator: tps6507x: Fix using wrong dev argument for calling of_regulator_match 2013-01-30 18:44:41 +08:00
tps6524x-regulator.c regulator: remove use of __devinit 2012-11-20 10:31:26 +09:00
tps6586x-regulator.c regulator: tps6586x: Use apply_[reg|bit] with regmap based voltage_sel operations 2012-12-24 16:34:11 +00:00
tps51632-regulator.c regulator: tps51632: Use regulator_[get|set]_voltage_sel_regmap 2013-02-13 12:58:40 +00:00
tps62360-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps65023-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps65090-regulator.c regulator: tps65090: Fix using wrong dev argument for calling of_regulator_match 2013-01-31 14:42:05 +08:00
tps65217-regulator.c regulator: tps65217: Fix using wrong dev argument for calling of_regulator_match 2013-01-24 18:58:33 +08:00
tps65910-regulator.c regulator: Add missing of_node_put() 2013-01-30 18:50:27 +08:00
tps65912-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps80031-regulator.c regulator: tps80031: Fix LDO2 track mode for TPS80031 or TPS80032-ES1.0 2013-04-23 11:47:37 +01:00
twl-regulator.c regulator: twl: Convert twl4030ldo_ops to get_voltage_sel 2013-03-01 16:03:49 +08:00
userspace-consumer.c regulator: userspace-consumer: Convert to use devm_* APIs 2012-04-18 10:26:24 +01:00
vexpress.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
virtual.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
wm831x-dcdc.c Merge remote-tracking branch 'regulator/topic/wm831x' into regulator-next 2012-12-10 12:43:33 +09:00
wm831x-isink.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
wm831x-ldo.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
wm8350-regulator.c regulator: wm8350: Reuse map_voltage() to get selector of a given uV 2012-06-17 20:53:58 +01:00
wm8400-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
wm8994-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00