aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2012-12-10Merge remote-tracking branch 'regulator/topic/max8973' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/max77686' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/max1586' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/log' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/gpio' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/da9055' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/da9052' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/change' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/as3711' into regulator-nextMark Brown
2012-12-10Merge remote-tracking branch 'regulator/topic/arizona' into regulator-nextMark Brown
2012-12-10regulator: anatop: Use regulator_[get|set]_voltage_sel_regmapAxel Lin
Call regulator_[get|set]_voltage_sel_regmap instead of open code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Ying-Chun Liu <paulliu@debian.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: anatop: Use linear_min_sel with linear mappingAxel Lin
By setting linear_min_sel to anatop_reg->min_bit_val, we can avoid adjust the anatop_reg->min_bit_val offset in [set|get]_voltage_sel. With this chance we can refactor this driver to use regulator_[get|set]_voltage_sel_regmap. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Ying-Chun Liu <paulliu@debian.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: max1586: Implement get_voltage_sel callbackAxel Lin
This is required since commit f7df20ec32 "regulator: core: Use list_voltage() to read single voltage regulators", otherwise _regulator_get_voltage returns rdev->desc->ops->list_voltage(rdev, 0). The Maxim 1586 controls V3 and V6 voltages, but offers no way of reading back the set up value. Thus this patch caches the setting when setting new voltage. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: lp8788-buck: Kill _gpio_request functionAxel Lin
Simply use devm_gpio_request_one() instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07regulator: tps80031: Convert tps80031_ldo_ops to linear_min_sel and ↵Axel Lin
list_voltage_linear Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07regulator: lp8788-ldo: Remove val array in lp8788_config_ldo_enable_modeAxel Lin
To clear the mask bit, setting data argument to be 0 with proper mask setting for lp8788_update_bits. We don't need the var array here. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06regulator: gpio-regulator: Add ifdef CONFIG_OF guard for regulator_gpio_of_matchAxel Lin
Use of_match_ptr and add ifdef CONFIG_OF guard for regulator_gpio_of_match. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06regulator: palmas: Convert palmas_ops_smps to ↵Axel Lin
regulator_[get|set]_voltage_sel_regmap Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06regulator: palmas: Return raw register values as the selectors in ↵Axel Lin
[get|set]_voltage_sel Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead. For smps*(except smps10), the vsel reg-value and voltage mapping as below: reg-value volt (uV) ( Assume RANGE is x1 ) 0 0 1 500000 2 500000 3 500000 4 500000 5 500000 6 500000 (0.49V + 1 * 0.01V) * RANGE 7 510000 (0.49V + 2 * 0.01V) * RANGE 8 520000 (0.49V + 3 * 0.01V) * RANGE 9 530000 (0.49V + 4 * 0.01V) * RANGE .... The linear mapping is start from selector 6. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06regulators: add regulator_can_change_voltage() functionMarek Szyprowski
Introduce a regulator_can_change_voltage() function for the subsytems or drivers which might check if applying voltage change is possible and use special workaround code when the driver is used with fixed regulators or regulators with disabled ability to change the voltage. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03regulator: tps51632: Ensure [base|max]_voltage_uV pdata settings are validAxel Lin
If pdata->base_voltage_uV is missing or the settings of pdata->base_voltage_uV and pdata->max_voltage_uV are out of range, TPS51632_VOLT_VSEL macro returns wrong vsel. Thus add checking [base|max]_voltage_uV pdata settings in probe. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03regulator: wm831x-dcdc: Add MODULE_ALIAS for wm831x-boostpAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03regulator: wm831x-dcdc: Ensure selected voltage falls within requested rangeAxel Lin
Use DIV_ROUND_UP to ensure selected voltage won't less than min_uV due to integer truncation. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28Merge branch 'topic/tps51632' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-min Conflicts: drivers/regulator/tps51632-regulator.c
2012-11-28regulator: tps51632: Use linear_min_sel and regulator_[map|list]_voltage_linearAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: pcf50633: Use linear_min_sel and regulator_[map|list]_voltage_linearAxel Lin
This driver can be converted to use linear_min_sel and regulator_[map|list]_voltage_linear. Below shows the equation (from Datasheet) for each LDOs. For AUTOOUT: VO(prog) = 0.625 + auto_out x 0.025 V; e.g. (00000000 to 00101110: reserved) 00101111: 1.8 V (min) 01010011: 2.7 V 01101010: 3.275 V 01101011: 3.300 V 01101100: 3.325 V 01111111 : 3.800 V (max) The linear mapping start from 0x2f selector. Thus we convert this equation to: VO(prog) = 1.8 + (selector - linear_min_sel) x 0.025 V (min_uV = 1800000, uV_step = 25000, linear_min_sel = 0x2f) For DOWNxOUT: VO(prog) = 0.625 + downx_out x 0.025 V; e.g. 00000000 : 0.625 V (min) 00010111 : 1.200 V 00101111 : 1.800 V 01011111 : 3.000 V (max) For xLDOOUT: VO(prog) = 0.9 + xldo_out x 0.1 V; e.g. 00000: 0.9 V 00001: 1.0 V 11000 : 3.3 V 11011 : 3.6 V Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: arizona-micsupp: Add ramp time informationMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: core: Say what unsupportable voltage constraints areMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: core: Log when a device causes a voltage constraint failMark Brown
Helps with figuring out when things went wrong. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: arizona-ldo1: Support 1.8V modeMark Brown
Some Arizona device support a 1.8V output mode. Enable this in the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: arizona-ldo1: Add additional top voltageMark Brown
The number of voltage slots supported by the LDO is 7, not 6. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: arizona-ldo1: Support DVFS in default constraintsMark Brown
Some Arizona devices such as the WM5102 can use DVFS on their digital core, for these devices allow the voltage range to vary in the default setup. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28regulator: arizona-ldo1: Add enable timeMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: as3711: Fix the logic in as3711_sel_checkAxel Lin
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>
2012-11-27regulator: as3711: Fix valid min_uV/max_UV checking in as3711_bound_checkAxel Lin
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>
2012-11-27regulator: s2mps11: Fix ramp delay value shift operationSangbeom Kim
This patch fix the abnormal ramp delay setting. The shift operation was wrong. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-27regulator: da9052: Ensure setting current limit within specific rangeAxel Lin
Checking da9052_current_limits[row][i] <= max_uA is not enough, it is possible da9052_current_limits[row][i] may less than the requested min_uA. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: da9055: Select maximum current in specific range for ↵Axel Lin
set_current_limit Selecting the minimal value is only true for voltage regulators. For current regulators the maximum in the given range should be selected instead. This issue was reported by Heiko Stuebner for gpio-regulator driver [1], and the conclusion is to select the max current for current regulators [2]. [1] https://lkml.org/lkml/2012/8/5/162 [2] https://lkml.org/lkml/2012/8/6/183 This patch also ensures da9055_buck_set_current_limit return -EINVAL when the supported current limit does not meet the request range. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: tps6586x: fix build warning in debug buildLaxman Dewangan
When building the driver in debug mode, it generates warning as drivers/regulator/tps6586x-regulator.c: In function 'tps6586x_regulator_probe': drivers/regulator/tps6586x-regulator.c:392:9: warning: 'id' is used uninitialized in this function [-Wuninitialized] Fix this warning. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reported-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: tps51632: Fix writing to wrong register when enable_pwm_dvfs is setAxel Lin
When tps->enable_pwm_dvfs is true, write to TPS51632_VOLTAGE_BASE_REG rather than TPS51632_VOLTAGE_SELECT_REG. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: da9055: Use linear_min_sel and regulator_[map|list]_voltage_linearAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27Merge branches 'topic/da9055' and 'topic/tps51632' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-min
2012-11-27regulator: palmas: Use linear_min_sel and regulator_[map|list]_voltage_linearAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27regulator: core: Allow specific minimal selector for starting linear mappingAxel Lin
Some drivers (at least 3 drivers) have such variant of linear mapping that the first few selectors are invalid and the reset are linear mapping. Let's support this case in core. This patch adds linear_min_sel in struct regulator_desc, so we can allow specific minimal selector for starting linear mapping. Then extends regulator_[map|list]_voltage_linear() to support this feature. Note that for selectors less than min_linear_index, we need count them to n_voltages so regulator_list_voltage() won't fail while checking the boundary for selector before calling list_voltage callback. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-27Merge branch 'topic/hotplug' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-max8997 Conflicts: drivers/regulator/max8997.c
2012-11-27regulator: add device tree support for max8997Thomas Abraham
Add device tree based discovery support for max8997. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-24regulator: max8997: limit the number of dvs registers programmed in non-dvs modeThomas Abraham
In case the gpio based volatage selection mode is not used for either of buck 1/2/5, then only the BUCKxDVS1 register need to be programmed. So determine whether dvs mode is used and limit the loop count appropriately. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-24regulator: max8997: reorder buck1/2/5 dvs setup codeThomas Abraham
The BUCKxDVSx register programming is now moved prior to setting up of the gpio based dvs mode. This will ensure that all the BUCKxDVSx registers are programmed with appropriate voltage values before the gpio based dvs mode is selected for buck1/2/5. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>