aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27regulator: rn5t618: add RC5T619 PMIC supportPierre-Hugues Husson2-6/+33
Extend the driver to support Ricoh RC5T619. Support the additional regulators and slightly different voltage ranges. Signed-off-by: Pierre-Hugues Husson <phh@phh.me> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-21regulator: ltc3589: constify i2c_device_idArvind Yadav1-1/+1
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-21regulator: fan53555: fix I2C device idsGuillaume Tucker1-1/+4
The device tree nodes all correctly describe the regulators as syr827 or syr828, but the I2C device id is currently set to the wildcard value of syr82x in the driver. This causes udev to fail to match the driver module with the modalias data from sysfs. Fix this by replacing the I2C device ids with ones that match the device tree descriptions, with syr827 and syr828. Tested on Firefly rk3288 board. The syr82x id was not used anywhere. Fixes: e80c47bd738b (regulator: fan53555: Export I2C module alias information) Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-21regulator: rk808: Add regulator driver for RK805Elaine Zhang2-2/+132
Add support for the rk805 regulator. The regulator module consists of 4 DCDCs, 3 LDOs. The output voltages are configurable and are meant to supply power to the main processor and other components. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-08-15regulator: mt6380: Add support for MT6380Chenglin Xu3-0/+362
The MT6380 is a regulator found those boards with MediaTek MT7622 SoC It is connected as a slave to the SoC using MediaTek PMIC wrapper which is the common interface connecting with Mediatek made various PMICs. Signed-off-by: Chenglin Xu <chenglin.xu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-11PM / s2idle: Rename PM_SUSPEND_FREEZE to PM_SUSPEND_TO_IDLERafael J. Wysocki1-1/+1
To make it clear that the symbol in question refers to suspend-to-idle, rename it from PM_SUSPEND_FREEZE to PM_SUSPEND_TO_IDLE. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-07-24regulator: pwm-regulator: Remove unneeded gpiod NULL checkFabio Estevam1-4/+2
The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-20regulator: core: fix a possible race in disable_work handlingTirupathi Reddy1-2/+10
A race condition between queueing and processing the disable_work instances results in having a work instance in the queue and the deferred_disables variable of regulator device structure having a value '0'. If no new regulator_disable_deferred() call later from clients, the deferred_disables variable value remains '0' and hits BUG() in regulator_disable_work() when the queued instance scheduled for processing the work. The race occurs as below: Core-0 Core-1 ..... /* deferred_disables = 2 */ ..... ..... /* disable_work is queued */ ..... ..... ..... regulator_disable_deferred: regulator_disable_work: mutex_lock(&rdev->mutex); ..... rdev->deferred_disables++; ..... mutex_unlock(&rdev->mutex); ..... queue_delayed_work(...) mutex_lock(&rdev->mutex); ..... count =rdev->deferred_disables; ..... rdev->deferred_disables = 0; ..... ..... ..... mutex_unlock(&rdev->mutex); ..... ..... ..... return; ..... ..... /* No new regulator_disable_deferred() calls from clients */ /* The newly queued instance is scheduled for processing */ ..... ..... regulator_disable_work: ..... mutex_lock(&rdev->mutex); BUG_ON(!rdev->deferred_disables); /* deferred_disables = 0 */ The race is fixed by removing the work instance that is queued while processing the previous queued instance. Cancel the newly queued instance from disable_work() handler just after reset the deferred_disables variable to value '0'. Also move the work queueing step before mutex_unlock in regulator_disable_deferred(). Also use mod_delayed_work() in the pace of queue_delayed_work() as queue_delayed_work() always uses the delay requested in the first call when multiple consumers call regulator_disable_deferred() close in time and does not guarantee the semantics of regulator_disable_deferred(). Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-20regulator: fan53555: Use of_device_get_match_data() to simplify probeJisheng Zhang1-8/+2
if fan53555_regulator_probe() is called and the "client->dev.of_node" isn't NULL, it means OF registered a device with a valid compatible string, so match cannot be NULL. Use of_device_get_match_data() to retrieve the drvdata pointer. No functional change intended. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-19regulator: of: regulator_of_get_init_data() missing of_node_get()Frank Rowand1-1/+1
Boot fails for qcom-apq8074-dragonboard on 4.13-rc1 with error: OF: ERROR: Bad of_node_put() on /soc/spmi@fc4cf000/pm8941@1/regulators The error will occur if the configuration is set to: CONFIG_OF_OVERLAY y CONFIG_OF_UNITTEST y CONFIG_OF_DYNAMIC y CONFIG_OF_RESOLVE y If CONFIG_OF_DYNAMIC is enabled then of_node_release() detects an attempt to release a node that is still attached to the device tree. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-19regulator: Convert to using %pOF instead of full_nameRob Herring3-5/+5
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17regulator: cpcap: Add OF mode mappingSebastian Reichel1-0/+13
Add device tree mode mapping capabilities to the cpcap driver. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17regulator: cpcap: Fix standby modeSebastian Reichel1-3/+5
The original patch from Tony uses standby mode bit inverted, which is not correct. This fixes all instances in the driver code for get & set mode. This did not yet make problems, since mode has not been changed by any mainline driver so far. Fixes: 0ad4c07edd41 ("regulator: cpcap: Add basic regulator support") Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-07-10regulator: cpcap: Fix standby modeSebastian Reichel1-3/+5
The original patch from Tony uses standby mode bit inverted, which is not correct. This fixes all instances in the driver code for get & set mode. This did not yet make problems, since mode has not been changed by any mainline driver so far. Fixes: 0ad4c07edd41 ("regulator: cpcap: Add basic regulator support") Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-07-07regulator: axp20x: add NULL check on devm_kzalloc() return valueGustavo A. R. Silva1-0/+6
Check return value from call to devm_kzalloc() in order to prevent a NULL pointer dereference. This issue was detected using Coccinelle and the following semantic patch: @@ expression x; identifier fld; @@ * x = devm_kzalloc(...); ... when != x == NULL x->fld Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-07regulator: qcom_smd: add NULL check on of_match_device() return valueGustavo A. R. Silva1-0/+5
Check return value from call to of_match_device() in order to prevent a NULL pointer dereference. In case of NULL print error message and return. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-07regulator: qcom_rpm-regulator: add NULL check on of_match_device() return valueGustavo A. R. Silva1-0/+5
Check return value from call to of_match_device() in order to prevent a NULL pointer dereference. In case of NULL print error message and return. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-03Merge remote-tracking branches 'regulator/topic/settle', 'regulator/topic/tps65910' and 'regulator/topic/tps65917' into regulator-nextMark Brown4-5/+43
2017-07-03Merge remote-tracking branches 'regulator/topic/hi6421v530', 'regulator/topic/lp8755', 'regulator/topic/lp87565', 'regulator/topic/max8997' and 'regulator/topic/palmas' into regulator-nextMark Brown7-14/+481
2017-07-03Merge remote-tracking branches 'regulator/topic/axp20x', 'regulator/topic/bd9571mwv', 'regulator/topic/da9061' and 'regulator/topic/hi6421' into regulator-nextMark Brown5-42/+437
2017-07-03Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown1-28/+18
2017-06-30regulator: core: Fix size limit of supply_mapHaishan Zhou1-23/+13
Now the debugfs file supply_map has a size limit PAGE_SIZE and the user can not see the whole content of regulator_map_list when it is larger than this limit. This patch uses seq_file instead to make sure supply_map shows the full information of regulator_map_list. Signed-off-by: Haishan Zhou <zhssmail@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-28regulator: core: Fix voltage change propagations to supply regulatorsTirupathi Reddy1-1/+2
Some regulators support get_voltage() and some support get_voltage_sel() operations but currently we only propagate changes if the regulator has a get_voltage() operation. Also do this if we've got get_voltage_sel() [Rewite commit message for clarity -- broonie] Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-20regulator: lp87565: Fix the initial voltage rangeKeerthy1-1/+1
The latest documentation reveals that initial voltage range that is supported is starting from 0.6V for all the PMICs belonging to lp87565 family. Fix the same. Signed-off-by: Keerthy <j-keerthy@ti.com> Fixes: f0168a9bf ("regulator: lp87565: Add support for lp87565 PMIC regulators") Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-14regulator: hi6421v530: Describe consumed platform deviceGuodong Xu1-0/+7
The hi6421v530-regulator driver consumes a similarly named platform device. Adding that to the module device table, allows modprobe to locate this driver once the device is created. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13regulator: tps65910: check TPS65910_NUM_REGS at build timeMichał Mirosław1-2/+3
Check TPS65910_NUM_REGS at build time instead of silently registering not all regulators at runtime. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13regulator: core: Prioritise consumer mappings over regulator nameCharles Keepax1-5/+5
Currently, when looking up a regulator supply, the regulator name takes priority over the consumer mappings. As there are a lot of regulator names that are in fairly common use (VDD, MICVDD, etc.) this can easily lead to obtaining the wrong supply, when a system contains two regulators that share a name. The explicit consumer mappings contain much less ambiguity as they specify both a name and a consumer device. As such prioritise those if one exists and only fall back to the regulator name if there are no matching explicit mappings. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07regulator: lp87565: Fix the GPL headerKeerthy1-2/+1
Fix the GPL header to reflect GPL v2 Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07regulator: hi6421: Describe consumed platform deviceGuodong Xu1-0/+7
The hi6421-regulator driver consumes a similarly named platform device. Adding that to the module device table, allows modprobe to locate this driver once the device is created. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07regulator: hi6421v530: add driver for hi6421v530 voltage regulatorWang Xiaoyin3-0/+218
add the driver for hi6421v530 voltage regulator Signed-off-by: Wang Xiaoyin <hw.wangxiaoyin@hisilicon.com> Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07regulator: da9061: BUCK and LDO regulator driverSteve Twiss2-14/+293
Regulator support for the DA9061 is added into the DA9062 regulator driver. The regulators for DA9061 differ from those of DA9062. A new DA9061 enumeration list for the LDOs and Bucks supported by this device is added. Regulator information added: the old regulator information for DA9062 is renamed from local_regulator_info[] to local_da9062_regulator_info[] and a new array is added to support local_da9061_regulator_info[]. The probe() function switches on the da9062_compatible_types enumeration and configures the correct da9062_regulator_info array and number of regulator entries. Kconfig is updated to reflect support for DA9061 and DA9062 regulators. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06regulator: bd9571mwv: Statize local symbolsAxel Lin1-6/+6
These functions are only used by this driver, make them static. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-25regulator: tps65917: Add support for SMPS12Keerthy1-3/+15
App support for SMPS12 dual phase regulator. Signed-off-by: Keerthy <j-keerthy@ti.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24regulator: lp87565: Add support for lp87565 PMIC regulatorsKeerthy3-0/+246
The regulators set consists of 4 BUCKs. The output voltages are configurable and are meant to supply power to the main processor and other components. The ramp delay is configurable for all BUCKs. The BUCKs can be configured in single phase or multiphase modes. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19regulator: axp20x-regulator: add support for AXP803Icenowy Zheng1-22/+131
AXP803 PMIC also have a series of regulators (DCDCs and LDOs) controllable via I2C/RSB bus. Add support for them. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19regulator: lp8755: fix spelling mistake "acceess" -> "access"Colin Ian King1-7/+7
Trivial fix to spelling mistake in dev_err messages. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17regulator: Allow for asymmetric settling timesMatthias Kaehlcke2-0/+25
Some regulators have different settling times for voltage increases and decreases. To avoid a time penalty on the faster transition allow for different settings for up- and downward transitions. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14regulator: palmas: Drop unnecessary staticJulia Lawall1-1/+1
Drop static on a local variable, when the variable is initialized before any use, on every possible execution path through the function. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @bad exists@ position p; identifier x; type T; @@ static T x@p; ... x = <+...x...+> @@ identifier x; expression e; type T; position p != bad.p; @@ -static T x@p; ... when != x when strict ?x = e; // </smpl> There is no reduction in code size in this case, but the change does reduce the size of the bss segment, containing uninitialized static data. before: text data bss dec hex filename 12882 3480 8 16370 3ff2 drivers/regulator/palmas-regulator.o after: text data bss dec hex filename 12882 3480 0 16362 3fea drivers/regulator/palmas-regulator.o Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14regulator: max8997/8966: fix charger cv voltage set bugMyungJoo Ham1-6/+3
When min charger-CV is <= 4.0V and max charger-CV is >= 4.0V, we can use 4.00V as CV (register value = 0x1).` The original code had a typo that wrote ">=" (max_uV >= 4000000), which should've been "<", which is not necessary anyway as mentioned by Dan Carpenter. Reported-By: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30Merge remote-tracking branch 'regulator/topic/vctrl' into regulator-nextMark Brown3-0/+554
2017-04-30Merge remote-tracking branches 'regulator/topic/notifier', 'regulator/topic/pfuze100', 'regulator/topic/settle', 'regulator/topic/tps65132' and 'regulator/topic/twl6030' into regulator-nextMark Brown7-2/+325
2017-04-30Merge remote-tracking branches 'regulator/topic/helpers', 'regulator/topic/hi655x', 'regulator/topic/lm363x', 'regulator/topic/ltc3589' and 'regulator/topic/ltc3676' into regulator-nextMark Brown5-3/+76
2017-04-30Merge remote-tracking branches 'regulator/topic/anatop', 'regulator/topic/arizona', 'regulator/topic/bd9571mvw-m' and 'regulator/topic/const' into regulator-nextMark Brown12-139/+390
2017-04-30Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown2-19/+16
2017-04-30Merge remote-tracking branches 'regulator/fix/isl9305', 'regulator/fix/rk808' and 'regulator/fix/tps65023' into regulator-linusMark Brown2-3/+2
2017-04-25regulator: Add ROHM BD9571MWV-M PMIC regulator driverMarek Vasut3-0/+190
Add driver for the regulator block in the ROHM BD9571MWV-W MFD PMIC. This block supports three voltage monitors, VD18, VD25, VD33 for the 1V8, 2V5, 3V3 voltage rails and a single voltage regulator for the DVFS rail. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona-ldo1: Factor out generic initializationRichard Fitzgerald1-48/+66
In preparation for sharing this driver with Madera codecs, factor out the parts of initialization that aren't dependent on struct arizona. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona-ldo1: Make arizona_ldo1 independent of struct arizonaRichard Fitzgerald1-4/+4
In preparation for supporting Madera codecs, remove the dependency on struct arizona in the regulator callbacks and struct arizona_ldo1. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona-ldo1: Move pdata into a separate structureRichard Fitzgerald1-18/+21
In preparation for sharing this driver with Madera, move the pdata for the LDO1 regulator out of struct arizona_pdata into a dedicated pdata struct for this driver. As a result the code in arizona_ldo1_of_get_pdata() can be made independent of struct arizona. This patch also updates the definition of struct arizona_pdata and the use of this pdata in mach-crag6410-module.c Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona-micsupp: Factor out generic initializationRichard Fitzgerald1-36/+46
In preparation for sharing this driver with Madera codecs, factor out the parts of initialization that aren't dependent on struct arizona. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>