summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-06-22 12:12:38 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-07-02 06:16:10 -0700
commit33b50b0bf4e501a81605c4351ff163d82c87e0d1 (patch)
treea4ab7e8b4396141a90c9502449b7bfcd628a08bc /drivers/regulator
parent7cf0e9ac73f66586b15ca96a86c7d95aecc9f4d7 (diff)
regulator: tps80031: support for min voltage tolerance
Sometimes the system allow to run in less than requested minimum voltage and if this tolerance allow the regulator to set voltage in lower side range than this saves the power. For the example, if client request vmin = 975mV for regulator voltage then it sets the voltage to 987.5mv as the nearest to this desired value. The next lower side for the voltage is 974.8mv. So if system runs on tolerance of 1mv and if it request for 975mv then driver can look for minimum voltage as 975 - tolerance(1) = 974mv and possible configure 974.8mv rather than 987.5mV and so it can save the power equivalent to 12.5mV higher voltage. Support the configuration of tolerance value. Change-Id: Ic8312bb397c2615a3ee0f84072ec394e513525ea Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/110523 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps80031-regulator.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/regulator/tps80031-regulator.c b/drivers/regulator/tps80031-regulator.c
index 4b1df3613f56..efc608c936ea 100644
--- a/drivers/regulator/tps80031-regulator.c
+++ b/drivers/regulator/tps80031-regulator.c
@@ -100,6 +100,7 @@ struct tps80031_regulator {
/* chip constraints on regulator behavior */
u16 min_mV;
u16 max_mV;
+ unsigned int tolerance_uv;
/* regulator specific turn-on delay */
int delay;
@@ -296,6 +297,8 @@ static int __tps80031_dcdc_set_voltage(struct device *parent,
int vsel = 0;
int ret;
+ min_uV = min_uV - ri->tolerance_uv;
+
switch (ri->flags) {
case 0:
if (min_uV == 0)
@@ -1025,6 +1028,7 @@ static int __devinit tps80031_regulator_probe(struct platform_device *pdev)
ri->dev = &pdev->dev;
if (tps_pdata->delay_us > 0)
ri->delay = tps_pdata->delay_us;
+ ri->tolerance_uv = tps_pdata->tolerance_uv;
check_smps_mode_mult(pdev->dev.parent, ri);
ri->platform_flags = tps_pdata->flags;