summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
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>
2012-11-24regulator: tps65090: Add MODULE_ALIASAxel Lin
This driver can be built as a module, add MODULE_ALIAS for it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-23regulator: max8973: provide enable/disable if external control disabledLaxman Dewangan
If external control is enabled then do not provide regulator enable/disable apis. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-23regulator: add a regulator driver for the AS3711 PMICGuennadi Liakhovetski
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>
2012-11-23regulator: tps80031: Implement list_voltage and set n_voltages = 1 for fixed ↵Axel Lin
regulators Implement list_voltage for fixed regulators, otherwise regulator_is_supported_voltage() returns 0. 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-23regulator: tps80031: Trivial cleanupsAxel Lin
This patch includes below cleanups: - Fix typo in comment - Fix showing wrong register in dev_err - Remove unnecessary rinfo variable - Add TPS80032 to MODULE_DESCRIPTION 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-22regulator: max8973: Fix callback setting for max8973_dcdc_ops.enableAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-21regulator: da9055: Properly handle voltage range that doesn't start with 0 ↵Axel Lin
offset This patch implements map_voltage and list_voltage callbacks to properly handle the case voltage range that doesn't start with 0 offset. Now we adjust the selector in map_voltage() before calling set_voltage_sel(). And return 0 in list_voltage() for invalid selectors. With above change, we can remove da9055_regulator_set_voltage_bits function. One tricky part is that we need adding voffset to n_voltages. Although for the cases "selector < voffset" are invalid, we need add voffset to n_voltage 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> Tested-by: Ashish Jangam <ashish.jangam@kpitcummins.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: wm831x: Set the new rather than old value for DVS VSELMark Brown
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-20Merge branch 'topic/tps6586x' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-hotplug Conflicts: drivers/regulator/tps6586x-regulator.c
2012-11-20regulator: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20Merge branches 'topic/tps51632', 'topic/tps80031', 'topic/vexpress', ↵Mark Brown
'topic/max8925', 'topic/gpio' and 'topic/tps65090' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-hotplug
2012-11-19regulator: max8973: add regulator driver supportLaxman Dewangan
The MAXIM MAX8973 high-efficiency, three phase, DC-DC step-down switching regulator delievers up to 9A of output current. Each phase operates at a 2MHz fixed frequency with a 120 deg shift from the adjacent phase, allowing the use of small magnetic component. Add regulator driver for this device. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-16regulator: da9055: Fix checking wrong value in da9055_gpio_initAxel Lin
Check pdata->gpio_rsel && pdata->gpio_rsel[id] for the case GPI pin is muxed with regulator to select the regulator register set A/B for voltage ramping. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-15regulator: tps80031: add prefix TPS80031 on common defines.Laxman Dewangan
Pefix "TPS80031" is added on all defines of tps80031 header to avoid conflict with other header definitions. Update the regualtor driver of tps80031 to use the same name. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-15regulator: DA9055 regulator driverAshish Jangam
This is the Regulator patch for the DA9055 PMIC and has got dependency on the DA9055 MFD core. This patch support all of the DA9055 regulators. The output voltages are fully programmable through I2C interface only. The platform data with regulation constraints is passed down from the board to the regulator. This patch is functionaly tested on SMDK6410 board. DA9055 Evaluation board was connected to the SMDK6410 board. Signed-off-by: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-15mfd: tps6586x: move regulator dt parsing to regulator driverLaxman Dewangan
Moving regulator node parsing to regulator driver in place of parsing it on mfd driver. The motivation for this change are: - MFD core driver should not depends on regulator and able to instantiate device without regulator. - The API for matching regulators are in regulator core and it is good that regulator driver only calls this API. - Regulator specific support should be in regulator driver only to ease any enhancement/modification for regulators. - The regulator driver is now registered as mfd sub device and all regulator registration is done from single probe call. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-15Merge remote-tracking branches 'regulator/fix/gpio', 'regulator/fix/put' and ↵Mark Brown
'regulator/fix/supp-volt' into tmp
2012-11-15regulator: fix voltage check in regulator_is_supported_voltage()Marek Szyprowski
regulator_is_supported_voltage() should return true only if the voltage of fixed/constant regulator is between min_uV and max_uV. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-14regulator: gpio-regulator: Catch 'no states property' misuseLee Jones
A selection of voltage or current values (AKA states) should always be specified when using a GPIO regulator. If there are no switchable states then the fixed regulators should be used instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-14regulator: core: Avoid deadlock when regulator_register failsCharles Keepax
When regulator_register fails and exits through the scrub path the regulator_put function was called whilst holding the regulator_list_mutex, causing deadlock. This patch adds a private version of the regulator_put function which can be safely called whilst holding the mutex, replacing the aforementioned call. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-13regulator: gpio-regulator: fix can't find regulator node in dtFrank Li
Need initilize of_node in regulator config when register regulator, otherwise regulator driver think it is no-dt device. in regulator_dev_lookup list_for_each_entry(r, &regulator_list, list) if (r->dev.parent && node == r->dev.of_node) return r r->dev.of_noe will be zero if miss config in cfg. Signed-off-by: Frank Li <Frank.Li@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-13regulator: tps80031: add regulator driver for tps80031Laxman Dewangan
Add regulator driver for Texas Instrument TPS80031/TPS80032 device. TPS80031/ TPS80032 Fully Integrated Power Management with Power Path and Battery Charger. It has 5 configurable step-down converters, 11 general purpose LDOs, VBUS generator and digital output to control regulators. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-07regulator: max8925: support dt for regulatorQing Xu
Signed-off-by: Qing Xu <qingx@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-01regulator: tps51632: Fix trivial typo for TPS51632 Kconfig help textAxel 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-10-28Regulator: core: Unregister when gpio request fails.Andrew Lunn
If the gpio_request_one() fails, or returns EPROBE_DEFER, the regulator must be device_unregister()ed. When this is not done, there are WARNING: from sysfs: WARNING: at fs/sysfs/file.c:343 sysfs_open_file+0x238/0x268() Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-22regulator: max77686: Make max77686_enable() static.Yadwinder Singh Brar
This patch fixes a sparse warning. Since max77686_enable() is a callback,so it should be static. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-17regulator: gpio-regulator: Allow use of GPIO controlled regulators though DTLee Jones
Here we provide the GPIO Regulator driver with Device Tree capability, so that when a platform is booting with DT instead of platform data we can still make full use of it. Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>