summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/as3711-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'regulator/topic/linear' into regulator-nextMark Brown2013-10-241-14/+7
|\
| * regulator: Add REGULATOR_LINEAR_RANGE macroAxel Lin2013-10-111-11/+7
| | | | | | | | | | | | | | Add REGULATOR_LINEAR_RANGE macro and convert regulator drivers to use it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * regulator: Remove max_uV from struct regulator_linear_rangeAxel Lin2013-10-111-14/+11
| | | | | | | | | | | | | | | | | | linear ranges means each range has linear voltage settings. So we can calculate max_uV for each linear range in regulator core rather than set the max_uV field in drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | regulator: as3711: Convert to devm_regulator_registerAxel Lin2013-09-171-20/+2
|/ | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: as3711: Convert to use linear rangesAxel Lin2013-07-241-132/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* regulator: as3711: Use a static of_regulator_match table for of_regulator_matchAxel Lin2013-04-171-25/+18
| | | | | | | | | | | | | The same table can be used for multiple instance of pdev, so we don't need to allocate memory for of_regulator_match table per pdev. match->driver_data points to the corresponding entry of as3711_reg_info, however it is not used in current code, thus this patch does not set driver_data in the of_regulator_match table. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: as3711: add OF supportGuennadi Liakhovetski2013-03-251-3/+71
| | | | | | | | | AS3711 regulator OF support only evaluates standard regulator DT properties. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: as3711: Fix checking if no platform initialization dataAxel Lin2013-02-131-1/+1
| | | | | | | | | To skip registering regulator if no platform initialization data, we should check reg_data rather than ri->desc.name. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: as3711: Fix the logic in as3711_sel_checkAxel Lin2012-11-271-15/+8
| | | | | | | | | | | | | | | | | | | | Below equation means the "voltage" is the "smallest" voltage within specific range. ret = DIV_ROUND_UP(min - bottom) / step; voltage = ret * step + bottom; If we do try 1 down when (voltage > max), new voltage is then less than min voltage. Which means the new voltage is not in the requested voltage range. This patch also includes below cleanups: - Use DIV_ROUND_UP - rename variable 'ret' to 'sel' for better readability because as3711_sel_check returns the selector. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: as3711: Fix valid min_uV/max_UV checking in as3711_bound_checkAxel Lin2012-11-271-6/+3
| | | | | | | | | | | | | | | | | Below cases are supposed to be valid: min_uV == max_uV == info->max_uV min_uV == max_uV == rdev->desc->min_uV Don't return -EINVAL for above cases. This patch also includes below cleanups: - Use rdev_get_drvdata(rdev) instead of rdev->reg_data. - Remove unnecessary WARN_ON, it looks pointless. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: add a regulator driver for the AS3711 PMICGuennadi Liakhovetski2012-11-231-0/+379
This driver supports the 4 DCDC and 8 LDO regulators on the AS3711 PMIC. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud