linux-stable/drivers/regulator
Matt Sealey ccf3ed782a regulator: mc13892-regulator: correct/refine handling of the SWxHI bit
MC13892 PMIC supports a "HI" bit for 3 of it's 4 buck switcher outputs,
which enables a higher set of voltage ranges.

Despite a comment in the code ('sw regulators need special care due to the
"hi" bit'), it actually does not take special care since it does not modify
it's use of the selector table index when this bit is set, giving us very
odd behavior when setting a high voltage on supported switchers or listing
current voltages. Net effect is in best case the kernel and sysfs report
lower voltages than are actually set in hardware (1300mV instead of 1800mV
for example) and in the worst case setting a voltage (e.g. 1800mV) will cause
an undervoltage condition (e.g. 1300mV).

Correct the behavior, taking into account SW1 doesn't support the HI bit,
and as such we need to ignore it.

While we are modifying these functions, fix and optimize the following;

* set_voltage_sel callback was using .reg instead of .vsel_reg - since
  they were set to the same value it actually didn't break anything but
  it would be semantically incorrect to use .reg in this case. We now use
  .vsel_reg and be consistent.
* vsel_shift is always 0 for every SWx regulator, and constantly shifting
  and masking off the bottom few bits is time consuming and makes the
  code very hard to read - optimize this out.
* get_voltage_sel uses the variable "val" and set_voltage_sel uses the
  variable "selector" (and reg_value). Introduce the variable "selector"
  to get_voltage_sel such that it makes more sense and allow some leaner
  code in light of the modifications in this patch. Add better exposure
  to the debug print so the register value AND the selector are printed as
  this will adequately show the HI bit in the register.
* correct a comment in probe which is doing a version check. Magic
  values are awful but for once instance, a comment does just as
  good a job as something symbolic.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
Tested-by: Steev Klimaszewski <steev@genesi-usa.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-27 11:22:21 +08:00
..
88pm8607.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09: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 Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -08: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 Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-next 2012-12-10 12:42:55 +09:00
as3711-regulator.c regulator: as3711: Fix the logic in as3711_sel_check 2012-11-27 20:25:18 +00:00
core.c regulator: core: Fix comment for regulator_register() 2013-01-03 13:02:39 +00: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/hotplug' into regulator-next 2012-12-10 12:42:55 +09:00
da9055-regulator.c Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
db8500-prcmu.c regulator: remove use of __devinit 2012-11-20 10:31:26 +09:00
dbx500-prcmu.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09: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 Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -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/max8973' into regulator-next 2012-12-10 12:42:59 +09:00
lp872x.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
lp3971.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
lp3972.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
lp8788-buck.c Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-next 2012-12-10 12:42:57 +09:00
lp8788-ldo.c Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-next 2012-12-10 12:42:57 +09:00
Makefile Merge remote-tracking branch 'regulator/topic/max8973' into regulator-next 2012-12-10 12:42:59 +09: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: remove use of __devexit 2012-11-20 10:53:38 +09:00
max8925-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09: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 regulator: max8997: Use uV in voltage_map_desc 2013-01-08 11:14:35 +00:00
max8998.c regulator: max8998: Ensure enough delay time for max8998_set_voltage_buck_time_sel 2013-01-10 12:55:49 +00:00
max77686.c Merge remote-tracking branch 'regulator/topic/max77686' into regulator-next 2012-12-10 12:42:58 +09:00
mc13xxx-regulator-core.c regulator: remove use of __devinit 2012-11-20 10:31:26 +09:00
mc13xxx.h regulator: mc13xxx: Remove get_voltage implementation for single voltage regulators 2012-08-28 11:00:27 -07:00
mc13783-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
mc13892-regulator.c regulator: mc13892-regulator: correct/refine handling of the SWxHI bit 2013-01-27 11:22:21 +08:00
of_regulator.c regulator: deprecate regulator-compatible DT property 2012-09-25 13:44:47 +01:00
palmas-regulator.c Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57: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 Merge remote-tracking branch 'regulator/topic/s2mps11' into regulator-next 2012-12-10 12:43:19 +09:00
s5m8767.c regulator: s5m8767: Fix probe failure due to stack corruption 2012-12-24 16:24:37 +00:00
tps6105x-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps6507x-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps6524x-regulator.c regulator: remove use of __devinit 2012-11-20 10:31:26 +09:00
tps6586x-regulator.c Merge remote-tracking branch 'regulator/topic/tps6586x' into regulator-next 2012-12-10 12:43:29 +09:00
tps51632-regulator.c Merge remote-tracking branch 'regulator/topic/tps516312' into regulator-next 2012-12-10 12:43:24 +09: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 Merge remote-tracking branch 'regulator/topic/tps65090' into regulator-next 2012-12-10 12:43:27 +09:00
tps65217-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps65910-regulator.c Merge remote-tracking branch 'regulator/topic/tps65910' into regulator-next 2012-12-10 12:43:30 +09:00
tps65912-regulator.c regulator: remove use of __devexit 2012-11-20 10:53:38 +09:00
tps80031-regulator.c Merge remote-tracking branch 'regulator/topic/tps80031' into regulator-next 2012-12-10 12:43:32 +09:00
twl-regulator.c Drivers: regulator: remove __dev* attributes. 2013-01-03 15:57:04 -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