summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
AgeCommit message (Collapse)AuthorFilesLines
2017-04-30Merge remote-tracking branch 'regulator/topic/vctrl' into regulator-nextMark Brown3-0/+554
2017-04-30Merge remote-tracking branches 'regulator/topic/notifier', ↵Mark Brown7-2/+325
'regulator/topic/pfuze100', 'regulator/topic/settle', 'regulator/topic/tps65132' and 'regulator/topic/twl6030' into regulator-next
2017-04-30Merge remote-tracking branches 'regulator/topic/helpers', ↵Mark Brown5-3/+76
'regulator/topic/hi655x', 'regulator/topic/lm363x', 'regulator/topic/ltc3589' and 'regulator/topic/ltc3676' into regulator-next
2017-04-30Merge remote-tracking branches 'regulator/topic/anatop', ↵Mark Brown12-139/+390
'regulator/topic/arizona', 'regulator/topic/bd9571mvw-m' and 'regulator/topic/const' into regulator-next
2017-04-30Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown2-19/+16
2017-04-30Merge remote-tracking branches 'regulator/fix/isl9305', ↵Mark Brown2-3/+2
'regulator/fix/rk808' and 'regulator/fix/tps65023' into regulator-linus
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>
2017-04-25regulator: arizona-micsupp: Make arizona_micsupp independent of struct arizonaRichard Fitzgerald1-10/+17
In preparation for supporting Madera codecs, remove the dependency on struct arizona in the regulator callbacks and struct arizona_micsupp. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona-micsupp: Move pdata into a separate structureRichard Fitzgerald1-10/+11
In preparation for sharing this driver with Madera, move the pdata for the micsupp regulator out of struct arizona_pdata into a dedicated pdata struct for this driver. As a result the code in arizona_micsupp_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: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25regulator: arizona: Split KConfig options for LDO1 and MICSUPP regulatorsRichard Fitzgerald2-4/+13
The CS47L24 Arizona codec and most Madera codecs do not have a LDO1 regulator. Split the LDO1 and MICSUPP regulators into separate KConfig options so the LDO1 is only built into the kernel if needed. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25Merge tag 'v4.11-rc1' into regulator-arizonaMark Brown48-351/+882
Linux 4.11-rc1
2017-04-18regulator: tps65023: Fix inverted core enable logic.Richard Cochran1-2/+1
Commit 43530b69d758328d3ffe6ab98fd640463e8e3667 ("regulator: Use regmap_read/write(), regmap_update_bits functions directly") intended to replace working inline helper functions with standard regmap calls. However, it also inverted the set/clear logic of the "CORE ADJ Allowed" bit. That patch was clearly never tested, since without that bit cleared, the core VDCDC1 voltage output does not react to I2C configuration changes. This patch fixes the issue by clearing the bit as in the original, correct implementation. Note for stable back porting that, due to subsequent driver churn, this patch will not apply on every kernel version. Fixes: 43530b69d758 ("regulator: Use regmap_read/write(), regmap_update_bits functions directly") Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-04-14regulator: anatop: make sure regulator name is properly definedDong Aisheng1-2/+5
For anatop regulator we must have a name accordingly. Make sure the name is properly checked before using it to avoid a possible kernel NULL point crash. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14regulator: core: Allow dummy regulators for suppliesMark Brown1-8/+0
Rather than just not resolving the supply when there is explicitly no supply mapping fall through and allow a dummy supply to be substituted. This fixes issues with constant retries reported by Dong Aisheng. Signed-off-by: Mark Brown <broonie@kernel.org> Tested-by: Dong Aisheng <aisheng.dong@nxp.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
2017-04-14regulator: core: Only propagate voltage changes to if it can change voltagesMark Brown1-2/+4
When we are propagating voltage changes to parent regulators don't bother if the parent does not have permission to change voltages. This simplifies error checking in the function for cases where the regulator lacks some of the voltage operations. Reported-by: Dong Aisheng <aisheng.dong@nxp.com> Tested-by: Dong Aisheng <aisheng.dong@nxp.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14regulator: vctrl: Fix out of bounds array access for vctrl->vtableAxel Lin1-4/+4
Current code only allocates rdesc->n_voltages entries for vctrl->vtable. Thus use rdesc->n_voltages instead of n_voltages in the for loop. While at it, also switch to use devm_kcalloc instead of devm_kmalloc_array + __GFP_ZERO flag and fix the argument order. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14regulator: tps65132: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
drivers/regulator/tps65132-regulator.c:274:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-13regulator: tps65132: Fix off-by-one for .max_register settingAxel Lin1-1/+1
TPS65132_REG_CONTROL(0xFF) is the latest valid register. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-13regulator: anatop: set default voltage selector for pcieDong Aisheng1-0/+5
Set the initial voltage selector for vddpcie in case it's disabled by default. This fixes the below warning: 20c8000.anatop:regulator-vddpcie: Failed to read a valid default voltage selector. anatop_regulator: probe of 20c8000.anatop:regulator-vddpcie failed with error -22 Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Robin Gong <yibin.gong@nxp.com> Cc: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-12regulator: tps65132: add regulator driver for TI TPS65132Venkat Reddy Talla3-0/+294
Add regulator driver for the device TI TPS65132 which is single inductor - dual output power supply device. TPS65132 device is designed to support general positive/negative driven applications like TFT display panels. TPS65132 regulator driver supports to enable/disable and set voltage on its output. Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11regulator: anatop: remove unneeded name field of struct anatop_regulatorDong Aisheng1-4/+3
sreg->name is only used as an intermediate assign of rdesc->name, plus another strcmp. Since we already have rdesc->name, no need it anymore. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11regulator: anatop: use of_property_read_string to read the nameDong Aisheng1-1/+2
sreg->name is a string, so use a more proper api to read back the string instead of of_get_property. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11regulator: anatop: check return value of of_get_regulator_init_dataDong Aisheng1-0/+3
Should check the return value of of_get_regulator_init_data before using it. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-10regulator: Add driver for voltage controlled regulatorsMatthias Kaehlcke3-0/+554
The output voltage of a voltage controlled regulator can be controlled through the voltage of another regulator. The current version of this driver assumes that the output voltage is a linear function of the control voltage. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-06regulator: helpers: Add regmap set_pull_down helperCharles Keepax1-0/+18
Add a helper function regulator_set_pull_down_regmap to allow regmap based regulators to easily enable pull down. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-06regulator: helpers: Add regmap set_soft_start helperCharles Keepax1-0/+18
Add a helper function regulator_set_soft_start_regmap to allow regmap based regulators to easily enable soft start. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-05regulator: Add settling time for non-linear voltage transitionLaxman Dewangan2-0/+6
Some regulators (some PWM regulators) have the voltage transition non-linear i.e. exponentially. On such cases, the settling time for voltage transition can not be presented in the voltage-ramp-delay. Add new property for non-linear voltage transition and handle this in getting the voltage settling time. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-03regulator: hi655x: Describe consumed platform deviceJeremy Linton1-0/+7
The hi655x-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: Jeremy Linton <lintonrjeremy@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29regulator: arizona-ldo1: Avoid potential memory leak reading init_dataCharles Keepax1-4/+5
The device argument passed to of_get_regulator_init_data is used to do some devres memory allocation. Currently the driver passes the MFD device pointer to this function, this could result in the init_data allocation being leaked if the regulator is unbound but the MFD isn't. Correct this issue by correctly passing the local platform device. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29regulator: arizona-micsupp: Avoid potential memory leak reading init_dataCharles Keepax1-4/+5
The device argument passed to of_get_regulator_init_data is used to do some devres memory allocation. Currently the driver passes the MFD device pointer to this function, this could result in the init_data allocation being leaked if the regulator is unbound but the MFD isn't. Correct this issue by correctly passing the local platform device. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29regulator: core: Limit propagation of parent voltage count and listMatthias Kaehlcke1-2/+7
Commit 26988efe11b1 ("regulator: core: Allow to get voltage count and list from parent") introduces the propagation of the parent voltage count and list for regulators that don't provide this information themselves. The goal is to support simple switch regulators, however as a side effect normal continuous regulators can leak details of their supplies and provide consumers with inconsistent information. Limit the propagation of the voltage count and list to switch regulators. Fixes: 26988efe11b1 ("regulator: core: Allow to get voltage count and list from parent") Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29regulator: core: Fix kerneldoc commentsTamara Diaconita1-2/+0
Remove the description for the non-existing 'ret' to fix the build warning: ./drivers/regulator/core.c:1467: warning: Excess function parameter 'ret' description in 'regulator_dev_lookup'. The description found for the return value is: @ret: 0 on success, -ENODEV if lookup fails permanently, -EPROBE_DEFER if lookup could succeed in the future. Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24regulator: core: Add new notification for enabling of regulatorHarald Geyer1-0/+2
This is useful for devices, which need some time to start up, to help the drivers track how long the supply has been up already. Ie whether it can safely talk to the HW or needs to wait. Signed-off-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24regulator: rk808: Fix RK818 LDO2Wadim Egorov1-1/+1
Set the correct voltage select register for LDO2. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-03-24regulator: twl6030: remove redundant range check min_uV > 1300000 && min_uV ↵Colin Ian King1-2/+0
<= 1350000 It has been pointed out to me that the range for vsel = 58 is actually dead code as this is covered by an earlier check for (min_uV >= 700000) && (min_uV <= 1420000) so remove that check completely. Reported-by: Alban Auzeill <alban.auzeill@sonarsource.com> Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-17regulator: Mark supply_name const and duplicate it as suchStephen Boyd2-3/+3
The supply_name member of struct regulator can be const as we don't change it in the regulator core. Furthermore, when we copy the supply name we can use kstrdup_const() here to avoid a copy if the name is in the ro data section. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: s2mpa01: Fix inconsistent indentingKrzysztof Kozlowski1-5/+5
Broken indenting makes code more difficult to read and brings confusion. Fix warning reported by Smatch: s2mpa01.c:362 s2mpa01_pmic_probe() warn: inconsistent indenting Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: s5m8767: Constify regulator_opsKrzysztof Kozlowski1-2/+2
Static struct regulator_ops is not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: s2mps11: Constify regulator_opsKrzysztof Kozlowski1-8/+8
Static struct regulator_ops is not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: s2mpa01: Constify regulator_opsKrzysztof Kozlowski1-2/+2
Static struct regulator_ops is not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: max8660: Constify regulator_opsKrzysztof Kozlowski1-2/+2
Static struct regulator_ops (except max8660_dcdc_ops) are not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: max77693: Constify regulator_opsKrzysztof Kozlowski1-1/+1
Static struct regulator_ops is not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: max1586: Constify regulator_opsKrzysztof Kozlowski1-2/+2
Static struct regulator_ops is not modified so can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13regulator: pfuze100-regulator: add coin supportGeorge McCollister1-0/+24
Add support for PF0200 coin cell/super capacitor charger which works as a current limited voltage source via the LICELL pin. When VIN goes below a certain threshold LICELL is used to provide power for VSNVS which is usually used to hold up secure non-volatile storage and the real-time clock on the SoC. Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07regulator: lm363x: Use generic DT property name for external control pinsMilo Kim1-2/+2
Vpos and Vneg LDOs can be enabled or disabled by external GPIOs. Use general DT property 'enable-gpios' for this usage. Two enable pins are differentiable by selecting the index number. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07regulator: core: use snprintf() instead of scnprintf()Bartosz Golaszewski1-2/+2
When creating the link to the device sysfs entry, the regulator core calls scnprintf() and then checks if the returned value is greater or equal than the buffer size. The former can never happen as scnprintf() returns the number of bytes that were actually written to the buffer, not the bytes that *would* have been written. Use the right function in this case: snprintf(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>