]> Pileus Git - ~andy/linux/commit
regulator: as3711: Convert to use linear ranges
authorAxel Lin <axel.lin@ingics.com>
Tue, 16 Jul 2013 08:34:39 +0000 (16:34 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 24 Jul 2013 14:47:07 +0000 (15:47 +0100)
commit9234c636c52df48a3cf280428a1d04077eef21db
tree5dbacb315fa32dab50323844a07b81eb9e87b517
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b
regulator: as3711: Convert to use linear ranges

The SD, ALDO, and DLDO vlotage tables are composed of linear ranges.
This patch converts as3711 to use newly introduced helpers for multiple
linear ranges.

Below is the voltage table on datasheet:

SD:
00h:     DC/DC powered down
01h-40h: Volt = 0.6V + sdx_vsel * 12.5mV
41h-70h: Volt = 1.4V + (sdx_vsel - 40h) * 25mV
71h-7Fh: Volt = 2.6V + (sdx_vsel - 70h) * 50mV

ALDO:
0h-0Fh:  1.2V + ldox_vsel * 50mV
10h-1Fh: 1.8V + (ldox_vsel - 10h) * 100mV

DLDO:
00h-10h: Volt = 0.9V + ldox_vsel * 50mV
11h-1fh: Do not use
20h-3fh: Volt = 1.75V + (ldox_vsel - 20h) * 50mV

Note, when convert to use linear ranges APIs, the equation for SD needs below
adjustment because the linear ranges APIs wiil substract range->min_sel when
apply the equation.

SD ( the equation to be used with linear ranges APIs )
01h-40h: Volt = 0.6125V + (sdx_vsel - 1h) * 12.5mV
41h-70h: Volt = 1.425V + (sdx_vsel - 41h) * 25mV
71h-7Fh: Volt = 2.650V + (sdx_vsel - 71h) * 50mV

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/as3711-regulator.c