diff options
-rw-r--r-- | drivers/regulator/tps80031-regulator.c | 4 | ||||
-rw-r--r-- | include/linux/regulator/tps80031-regulator.h | 4 |
2 files changed, 8 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; diff --git a/include/linux/regulator/tps80031-regulator.h b/include/linux/regulator/tps80031-regulator.h index 1670d147fc3e..4dfdf7950918 100644 --- a/include/linux/regulator/tps80031-regulator.h +++ b/include/linux/regulator/tps80031-regulator.h @@ -74,6 +74,9 @@ enum { * @flags: Configuration flag to configure the rails. It should be ORed of * above enums. * @delay_us: Delay in microsecond after setting the desired voltage. + * @tolerance_uv: Tolerance micorvolts in minimum side. The voltage min + * will be adjusted to this tolerance like + * actual_vmin = vmin - tolerance_uv */ struct tps80031_regulator_platform_data { @@ -84,6 +87,7 @@ struct tps80031_regulator_platform_data { unsigned int ext_ctrl_flag; unsigned int flags; int delay_us; + unsigned int tolerance_uv; }; #endif /* __REGULATOR_TPS80031_H */ |