summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2014-10-15Merge tag 'for-v3.18' of git://git.infradead.org/battery-2.6Linus Torvalds
Pull power supply and reset updates from Sebastian Reichel: - Initial support for the following chips * max77836 (charger) * max14577 (charger) * bq27742 (battery gauge) * ltc2952 (poweroff) * stih416 (restart) * syscon-reboot (restart) * gpio-restart (restart) - cleanup of power supply core - misc fixes in power supply and reset drivers * tag 'for-v3.18' of git://git.infradead.org/battery-2.6: (48 commits) power: ab8500_fg: Fix build warning Documentation: charger: max14577: Update the date of introducing ABI power: reset: corrections for simple syscon reboot driver Documentation: power: reset: Add documentation for generic SYSCON reboot driver power: reset: Add generic SYSCON register mapped reset bq27x00_battery: Fix flag reading for bq27742 power: reset: use restart_notifier mechanism for msm-poweroff power: Add simple gpio-restart driver power: reset: st: Provide DT bindings for ST's Power Reset driver power: reset: Add restart functionality for STiH41x platforms power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge power: max14577: Fix circular config SYSFS dependency power: gpio-charger: do not use gpio value directly power: max8925: Use of_get_child_by_name power: max8925: Fix NULL ptr dereference on memory allocation failure bq27x00_battery: Add support to bq27742 Documentation: charger: max14577: Document exported sysfs entry devicetree: mfd: max14577: Add device tree bindings document power: max17040: Add ID for MAX77836 Fuel Gauge block charger: max14577: Configure battery-dependent settings from DTS and sysfs ... Conflicts: drivers/power/reset/Kconfig drivers/power/reset/Makefile
2014-09-30Merge remote-tracking branches 'regulator/topic/tps65217', ↵Mark Brown
'regulator/topic/tps65910' and 'regulator/topic/voltage-ev' into regulator-next
2014-09-30Merge remote-tracking branches 'regulator/topic/rk808', ↵Mark Brown
'regulator/topic/rn5t618' and 'regulator/topic/samsung' into regulator-next
2014-09-30Merge remote-tracking branches 'regulator/topic/max1586', ↵Mark Brown
'regulator/topic/max77802' and 'regulator/topic/of' into regulator-next
2014-09-30Merge remote-tracking branches 'regulator/topic/drivers', ↵Mark Brown
'regulator/topic/enable', 'regulator/topic/fan53555', 'regulator/topic/hi6421' and 'regulator/topic/isl9305' into regulator-next
2014-09-30Merge remote-tracking branches 'regulator/topic/as3711', ↵Mark Brown
'regulator/topic/axp20x', 'regulator/topic/bcm590xx' and 'regulator/topic/da9211' into regulator-next
2014-09-30Merge remote-tracking branches 'regulator/fix/da9211', ↵Mark Brown
'regulator/fix/ltc3589' and 'regulator/fix/tps65023' into regulator-linus
2014-09-30regulator: da9211: Fix a bug in update of mask bitJames Ban
This is a patch for fixing a bug about mask bit operation. Signed-off-by: James Ban <james.ban.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-28Merge remote-tracking branch 'regulator/topic/sky81452' into regulator-driversMark Brown
Conflicts: drivers/regulator/Kconfig drivers/regulator/Makefile
2014-09-28Merge remote-tracking branch 'regulator/topic/pwm' into regulator-driversMark Brown
Conflicts: drivers/regulator/Kconfig
2014-09-28regulator: pwm-regulator: get voltage and duty table from dtsChris Zhong
rename st-pwm to pwm-regulator. And support getting voltage & duty table from device tree, other platforms can also use this driver without any modify. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26regulator: qcom_rpm: Fix FORCE_MODE_IS_2_BITS macroAxel Lin
Current code does not take the macro parameter, fix it. This is not a problem at this moment because the only user actually passes vreg to FORCE_MODE_IS_2_BITS(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26regulator: qcom_rpm: Don't explicitly initialise the first field of configAxel Lin
Doing so generates a warning as the first field is a pointer but we use 0 to initialize it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26regulator: ltc3589: fix broken voltage transitionsSteffen Trumtrar
VCCR is used as a trigger to start voltage transitions, so we need to mark it volatile in order to make sure it gets written to hardware every time we set a new voltage. Fixes regulator voltage being stuck at the first voltage set after driver load. [lst: reworded commit message] Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-09-24regulator/mfd: max14577: Export symbols for calculating charger currentKrzysztof Kozlowski
This patch prepares for changing the max14577 charger driver to allow configuring battery-dependent settings from DTS. The patch moves from regulator driver to MFD core driver and exports: - function for calculating register value for charger's current; - table of limits for chargers (MAX14577, MAX77836). Previously they were used only by the max14577 regulator driver. In next patch the charger driver will use them as well. Exporting them will reduce unnecessary code duplication. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-24regulator: qcom-rpm: Regulator driver for the Qualcomm RPMBjorn Andersson
Driver for regulators exposed by the Resource Power Manager (RPM) found in Qualcomm 8660, 8960 and 8064 based devices. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-22regulator: axp20x: Use parent device as regulator configuration deviceMaxime Ripard
The current device used for the regulator configuration is the child device created by the MFD driver. This means that it doesn't have any of_node pointing to it, and whenever we register the regulators, it will not look into the regulator supply in the DT, hence requiring to provide regulator aliases in the MFD driver. We can easily fix that by using the parent device in our configuration, which has a DT node associated to it, and will allow a DT lookup. Eventually, we will be able to remove the aliases in the MFD driver. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-18regulator: fan53555: Fix null pointer dereferenceAxel Lin
Set di->regulator before dereference it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-18regulator: fan53555: Fixup report wrong vendor messageAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-17regulator: fan53555: fix wrong cast in probeHeiko Stübner
The vendor-id gathered from the dt match-data was cast to int but assigned to an unsigned long, producing warnings on at least sparc, like drivers/regulator/fan53555.c: In function 'fan53555_regulator_probe': >> drivers/regulator/fan53555.c:373:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] di->vendor = (int) match->data; Fix this by using an appropriate cast. Reported-by: kbuild test robot Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-16regulator: fan53555: add support for Silergy SYR82x regulatorsHeiko Stuebner
Silergy SYR82x regulators share the exact same functionality and register layout as the Fairchild FAN53555 regulators. Therefore extend the driver to add support for them. Both types use the same vendor id in their ID1 register, so it's not possible to distinguish them automatically. Similarly, the types also do not match. Type 8 used by the SYR827 and SYR828 start at 712.5mV and increment in 12.5mv steps, while the FAN53555 type 8 starts at 600mV and increments in 10mV steps. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-16regulator: fan53555: add devicetree supportHeiko Stuebner
Add the ability to parse regulator-data from the devicetree. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-16regulator: rk808: Add function for ramp delay for buck1/buck2Doug Anderson
On rk808 buck1 and buck2 have programmable ramp delays. Let's add a function to allow a client of rk808 to set them. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-16regulator: fan53555: use set_ramp_delay to set the ramp up slew rateHeiko Stuebner
The regulator constraints already provide a field for the ramp_delay, so there is no need to set this manually. Therefore implement the set_ramp_delay callback and convert the pdata value to the constraint value if necessary. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-15regulator: fan53555: enable vin supplyHeiko Stuebner
The regulator can be supplied by a parent regulator through its vin pin, so add the supply_name for it. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-12regulator: rk808: Fix missing of_node_putAxel Lin
1. Pass &pdev->dev rather than &client->dev to of_regulator_match, the *dev argument is used for devres to ensure devm_of_regulator_put_matches() will be called when unload the module. 2. of_get_child_by_name() returns a node pointer with refcount incremented. Thus add missing of_node_put(reg_np). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-12regulator: rk808: Remove unused variablesAxel Lin
Also remove non-informative comment. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10regulator: of: Add stub OF match function for !OF caseMark Brown
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10regulator: isl9305: REGULATOR_ISL9305 needs to select REGMAP_I2CAxel Lin
Fix ERROR: "devm_regmap_init_i2c" [drivers/regulator/isl9305.ko] undefined! Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10regulator: isl9305: Convert to new style DT parsingMark Brown
This removes some code and replaces it with data. Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10Merge branch 'topic/of' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-isl9305
2014-09-10regulator: tps65217: Use simplified DT parsingMark Brown
Remove a bunch of code in favour of data. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-10Merge branch 'topic/of' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-tps65217
2014-09-10regulator: of: Provide simplified DT parsing methodMark Brown
Currently regulator drivers which support DT all repeat very similar code to supply a list of known regulator identifiers to be matched with DT, convert that to platform data which is then matched up with the regulators as they are registered. This is both fiddly to get right and for devices which can use the standard helpers to provide their operations is the main source of code in the driver. Since this code is essentially identical for most drivers we can factor it out into the core, moving the identifiers in the match table into the regulator descriptors and also allowing drivers to pass in the name of the subnode to search. When a driver provides an of_match string for the regulator the core will attempt to use that to obtain init_data, allowing the driver to remove all explicit code for DT parsing and simply provide data instead. The current code leaks the phandles for the child nodes, this will be addressed incrementally and makes no practical difference for FDT anyway as the DT data structures are never freed. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-10regulator: rk808: Remove pdata from the regulatorChris Zhong
Signed-off-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-10regulator: remove unnecessary of_node_get() to parentGuodong Xu
These of_node_get() were added to balance refcount decrements inside of of_find_node_by_name(). See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") However of_find_node_by_name() was then replaced by of_get_child_by_name(), which doesn't call of_node_put() against its input parameter. So, need to remove these unnecessary of_node_get() calls. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-09regulator: tps65217: Remove unused driver_data from of_match tableMark Brown
We don't ever reference the driver_data we supply so remove it. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-07regulator: bcm590xx: Remove unused **info field from struct bcm590xx_regAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-07regulator: as3711: Remove unused fields from as3711_regulator_info and ↵Axel Lin
as3711_regulator The max_uV is not used, so remove it from struct as3711_regulator_info. Current code is using devm_regulator_register(), so we don't need to store *rdev in struct as3711_regulator for clean up. Also clean up AS3711_REG macro to remove _vshift, _min_uV and _max_uV arguments. _vshift is always 0, so remove it. _min_uV and _max_uV are not required, all required settings are set in REGULATOR_LINEAR_RANGE macro. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-06regulator: hi6421: Fix misleading commentAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-09-06regulator: tps65217: Remove spurious platform data checkMark Brown
We should always be able to probe a regulator with no platform data. This will enable readback of current state, though no changes can be made to the device configuration. Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-06regulator: isl9305: Add Intersil ISL9305/H driverMark Brown
The ISL9305 and ISL9305H are mini-PMICs offering two DCDC regulators and two LDO regulators. While there are some register differences between them these do not affect the current Linux driver as the relevant features are not yet supported. Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-05regulator: da9211: Set of_match_table and export device tableAxel Lin
Also move da9211_i2c_id and da9211_dt_ids close to the user for better readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-05regulator: max77802: Remove duplicate rdev_get_id() callAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-05regulator: hi6421: Fix misleading commentAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-03regulator: da9211: Fix missing config.of_node settingAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-02regulator: RK808: Add proper input supplies for rk808Doug Anderson
The original RK808 regulator driver didn't setup input supplies properly. Add them. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-02regulator: rk808: Fix n_voltages for DCDC4Axel Lin
The min_sel is 0, max_sel is 15, so n_voltages should be 16. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01regulator: max1586: of_get_max1586_platform_data() can be staticFengguang Wu
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01regulator: max1586: add device-tree supportRobert Jarzmik
Add device-tree support to max1586. The driver can still be used with the legacy platform data, or the new device-tree way. This work is heavily inspired by the device-tree support of its cousin max8660 driver. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>