aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-02-11regulator: lp8788-buck: Convert to linear rangeAxel Lin1-18/+20
linear range is suitable for this driver, let's convert it to linear range. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-11regulator: s2mps11: Fix steps for buck7, buck8 and LDO35Krzysztof Kozlowski1-3/+3
LDO35 uses 25 mV step, not 50 mV. Bucks 7 and 8 use 12.5 mV step instead of 6.25 mV. Wrong step caused over-voltage (LDO35) or under-voltage (buck7 and 8) if regulators were used (e.g. on Exynos5420 Arndale Octa board). Cc: <[email protected]> Fixes: cb74685ecb39 ("regulator: s2mps11: Add samsung s2mps11 regulator driver") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-08regulator: lm363x: Check return value of gpiod_get_index_optionalAxel Lin1-2/+4
gpiod_get_index_optional can return ERR_PTR, add IS_ERR checking for it. While at it, also remove a redundant NULL test for gpiod in error path. Signed-off-by: Axel Lin <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-08dt-bindings: regulator: update fixed-regulator exampleJohan Hovold1-2/+2
Fixed regulators do not have associated bus addresses and are typically placed directly under the root node where their names must still be unique despite not having a unit address. Fix the malformed example node which had a unit address but no "reg" property by dropping the unit address. Also, try to make the example more useful by using the recommended generic node name "regulator", but with a suffix reflecting the regulator name in order to make it unique. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-08regulator: rt5033: Constify rt5033_safe_ldo_ops and rt5033_buck_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-08regulator: fix device unlinkingGuennadi Liakhovetski1-9/+1
Device links are refcounted, device_link_remove() has to be called as many times as device_link_add(). Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-07regulator: lochnagar: Fix n_voltages setting for VDDCOREAxel Lin1-1/+1
With current n_voltages setting, regulator_list_voltage will return -EINVAL when selector >=57. The highest selector is 0x41, so the n_voltages should be 0x41+1, i.e. 66. Signed-off-by: Axel Lin <[email protected]> Acked-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: core: Only support passing enable GPIO descriptorsLinus Walleij2-37/+7
Now that we changed all providers to pass descriptors into the core for enable GPIOs instead of a global GPIO number, delete the support for passing GPIO numbers in, and we get a cleanup and size reduction in the core, and from a GPIO point of view we use the modern, cleaner interface. Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: gpio: Simplify probe pathLinus Walleij1-34/+24
Use devm_* managed device resources and create a local struct device *dev variable to simplify the code inside probe(). Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: fixed/gpio: Pull inversion/OD into gpiolibLinus Walleij17-66/+13
This pushes the handling of inversion semantics and open drain settings to the GPIO descriptor and gpiolib. All affected board files are also augmented. This is especially nice since we don't have to have any confusing flags passed around to the left and right littering the fixed and GPIO regulator drivers and the regulator core. It is all just very straight-forward: the core asks the GPIO line to be asserted or deasserted and gpiolib deals with the rest depending on how the platform is configured: if the line is active low, it deals with that, if the line is open drain, it deals with that too. Cc: Alexander Shiyan <[email protected]> # i.MX boards user Cc: Haojian Zhuang <[email protected]> # MMP2 maintainer Cc: Aaro Koskinen <[email protected]> # OMAP1 maintainer Cc: Tony Lindgren <[email protected]> # OMAP1,2,3 maintainer Cc: Mike Rapoport <[email protected]> # EM-X270 maintainer Cc: Robert Jarzmik <[email protected]> # EZX maintainer Cc: Philipp Zabel <[email protected]> # Magician maintainer Cc: Petr Cvek <[email protected]> # Magician Cc: Robert Jarzmik <[email protected]> # PXA Cc: Paul Parsons <[email protected]> # hx4700 Cc: Daniel Mack <[email protected]> # Raumfeld maintainer Cc: Marc Zyngier <[email protected]> # Zeus maintainer Cc: Geert Uytterhoeven <[email protected]> # SuperH pinctrl/GPIO maintainer Cc: Russell King <[email protected]> # SA1100 Tested-by: Marek Szyprowski <[email protected]> Tested-by: Janusz Krzysztofik <[email protected]> #OMAP1 Amstrad Delta Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: gpio: Convert to use descriptorsLinus Walleij4-113/+95
This converts the GPIO regulator driver to use decriptors only. We have to let go of the array gpio handling: the fetched descriptors are handled individually anyway, and the array retrieveal function does not make it possible to retrieve each GPIO descriptor with unique flags. Instead get them one by one. We request the "enable" GPIO separately as before, and make sure that this line is requested as nonexclusive since enable lines can be shared and the regulator core expects this. Most users of the GPIO regulator are using device tree. There are two boards in the kernel using the gpio regulator from a non-devicetree path: PXA hx4700 and magician. Make sure to switch these over to use descriptors as well. Cc: Philipp Zabel <[email protected]> # Magician Cc: Petr Cvek <[email protected]> # Magician Cc: Robert Jarzmik <[email protected]> # PXA Cc: Paul Parsons <[email protected]> # hx4700 Cc: Kevin Hilman <[email protected]> # Meson Cc: Neil Armstrong <[email protected]> # Meson Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: rk808: Convert rk805 buck1/2 to use linear rangeAxel Lin1-43/+12
It looks like linear range is suitable to describe the voltage table for rk805 buck1/2: selector 0 ~ 59: 0.7125V with uV_step = 12500 selector 60 ~ 62: 1.8V with uV_step = 200000 selector 63: 2.3V With this change, then rk805 buck1/2 can reuse rk808_reg_ops_ranges. Signed-off-by: Axel Lin <[email protected]> Tested-by: Otavio Salvador <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-06regulator: as3722: Correct minor typoCharles Keepax1-1/+1
A comma has been accidentally used where a semi-colon was clearly intended, correct this typo. Signed-off-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-04regulator: axp20x: fix ALDO2, DLDO2 and ELDO3 definitions for AXP803Vasily Khoruzhick1-3/+3
Looks like refactoring didn't go well and left ALDO2, DLDO2 and ELDO3 definitions broken for AXP803 - now they are using register address instead of mask. Fix it by using mask where necessary. Fixes: db4a555f7c4cf ("regulator: axp20x: use defines for masks") Signed-off-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-02regulator: rk808: Fix BUCK1/2 voltages on rk805Otavio Salvador1-8/+45
RK805 has the following voltage range for the BUCK1 and BUCK2 regulators: From 0.7125V to 1.45V in 12.5mV steps, 1.8V, 2V, 2.2V and 2.3V , which corresponds to the following values as per the RK805 datasheet: 000 000: 0.7125V 000 001: 0.725V …… 111 011: 1.45V 111 100: 1.8V 111 101: 2.0V 111 110: 2.2V 111 111: 2.3V This means that the voltage range is not linear and so RK805 can not reuse the same regulator_ops structure from RK808. Fix it by creating a list with the correct supported voltage values for RK805 BUCK1 and BUCK2 regulators. Tested on a rv1108-elgin-r1 board that now correctly reports a BUCK2 voltage of 2.2V instead of the unsupported value of 1.4875V. Fixes: c4e0d344c1f0 ("regulator: rk808: Add regulator driver for RK805") Signed-off-by: Otavio Salvador <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-02regulator: uniphier: Constify uniphier_regulator_opsAxel Lin1-1/+1
Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Kunihiko Hayashi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-02-02regulator: uniphier: Fix probe error handlingAxel Lin1-2/+4
Ensure unwind all resources if probe fails. Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Kunihiko Hayashi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-30regulator: max77650: Fix include filesAxel Lin1-1/+1
This is a platform driver, no need to include linux/i2c.h. Include linux/of.h for of_match_ptr. Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-29dt-bindings: regulator: add DT bindings for max77650Bartosz Golaszewski1-0/+41
Add the DT binding document for max77650 regulators. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-29regulator: max77650: add regulator supportBartosz Golaszewski3-0/+527
Add regulator support for max77650. We support all four variants of this PMIC including non-linear voltage table for max77651 SBB1 rail. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: axp20x: Fix incorrect vsel_mask settingsAxel Lin1-4/+4
Fix copy-paste mistake while converting to use defines for masks. Fixes: db4a555f7c4cf ("regulator: axp20x: use defines for masks") Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: isl6271a: Constify isl_core_ops and isl_fixed_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: isl6271a: Remove *rdev[3] from struct isl_pmicAxel Lin1-5/+4
This driver is using devm_regulator_register, so it's not necessary to store *rdev[3] in struct isl_pmic. Use a local variable instead. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: rk808: Update module description to include RK805Axel Lin1-2/+2
This driver also supports RK805 now. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: rk808: Constify regulator_opsAxel Lin1-21/+21
While at it, also fix indent for rk805_reg_ops and rk805_switch_ops. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: mcp16502: Include linux/gpio/consumer.h to fix build errorAxel Lin1-0/+1
Fix below build error: drivers/regulator/mcp16502.c: In function ‘mcp16502_gpio_set_mode’: drivers/regulator/mcp16502.c:135:3: error: implicit declaration of function ‘gpiod_set_value’; did you mean ‘gpio_set_value’? [-Werror=implicit-function-declaration] gpiod_set_value(mcp->lpm, 0); ^~~~~~~~~~~~~~~ gpio_set_value drivers/regulator/mcp16502.c: In function ‘mcp16502_probe’: drivers/regulator/mcp16502.c:486:13: error: implicit declaration of function ‘devm_gpiod_get’; did you mean ‘devm_gpio_free’? [-Werror=implicit-function-declaration] mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW); ^~~~~~~~~~~~~~ devm_gpio_free drivers/regulator/mcp16502.c:486:40: error: ‘GPIOD_OUT_LOW’ undeclared (first use in this function); did you mean ‘GPIOF_INIT_LOW’? mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW); ^~~~~~~~~~~~~ GPIOF_INIT_LOW Signed-off-by: Axel Lin <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: da9063: Check return value of devm_regmap_field_alloc callsAxel Lin1-5/+24
Since devm_regmap_field_alloc can fail, add error checking for it. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: da9062: Check return value of devm_regmap_field_alloc callsAxel Lin1-5/+24
Since devm_regmap_field_alloc can fail, add error checking for it. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: axp20x: fix ALDO2, DLDO2 and ELDO3 definitions for AXP803Vasily Khoruzhick1-3/+3
Looks like refactoring didn't go well and left ALDO2, DLDO2 and ELDO3 definitions broken for AXP803 - now they are using register address instead of mask. Fix it by using mask where necessary. Fixes: db4a555f7c4cf ("regulator: axp20x: use defines for masks") Signed-off-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp8788-ldo: Constify lp8788_dldo_desc and lp8788_aldo_descAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp8788-buck: Constify lp8788_buck_descAxel Lin1-1/+1
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp87565: Constify lp87565_buck_ramp_delay and lp87565_buck_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp8755: Constify lp8755_regulatorsAxel Lin1-1/+1
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp873x: Constify lp873x_buck01_ops and lp873x_ldo01_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp872x: Constify regulator_ops and regulator_descAxel Lin1-6/+6
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp3972: Constify lp3972_ldo_ops and lp3972_dcdc_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-28regulator: lp3971: Constify lp3971_ldo_ops and lp3971_dcdc_opsAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-25regulator: da9052: Use lowercase regulator names to match the DTRob Herring1-32/+32
Since c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons"), regulator node name comparisons are case sensitive. The DA9052 driver uses uppercase, but the DT has lowercase. Fix this by using a lowercase regulator name to match the DT node name. Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Cc: Support Opensource <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-25regulator: mc13xxx: Use lowercase regulator names to match the DTRob Herring3-81/+81
Since c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Vivien reported the mc13892-regulator complaining about not being able to find regulators. This is because prior to that commit we used of_node_cmp() to compare the regulator array passed from mc13892_regulators down to mc13xxx_parse_regulators_dt() and they are all defined in uppercase letters by the MC13892_*_DEFINE* macros, whereas they are defined as lowercase in the DTS. Fix this by using a lowercase regulator name to match the DT node name. Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Reported-by: Vivien Didelot <[email protected]> Reported-by: Florian Fainelli <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Rob Herring <[email protected]> Tested-by: Vivien Didelot <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-24regulator: bd9571mwv: Constify regulator_opsAxel Lin1-4/+4
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-24regulator: bd718x7: Constify regulator_opsAxel Lin1-7/+7
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-24regulator: bd70528: Constify regulator_linear_range and regulator_opsAxel Lin1-9/+8
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-23regulator: stpmic1: Add static const qualifier at peroper placesAxel Lin1-21/+17
The regulator_linear_range arrays and stpmic1_regulator_cfgs are only accessed by this driver and the values are never changed so make them static const. regulator_ops variables can also be const. Also clean up a few empty lines in regulator_linear_range array. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-23regulator: bindings: ROHM bd70528 regulator bindingsMatti Vaittinen1-0/+68
ROHM bd70528 is a ultra low power PMIC which includes 3 bucks, 3 LDOs and 2 LED drivers. Document the bindings for them. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-23regulator: bd70528: Support ROHM BD70528 regulator blockMatti Vaittinen3-0/+302
BD70528MWV is an ultra-low Iq general purpose single-chip power management IC for battery-powered portable devices. Add support for controlling 3 bucks and 3 LDOs present in ROHM BD70528. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-22regulator: qcom-smd: Batch up requests for disabled regulatorsBjorn Andersson1-35/+69
In some scenarios the early stages of the boot chain has configured regulators to be in a required state, but the later stages has skipped to inform the RPM about it's requirements. But as the SMD RPM regulators are being initialized voltage change requests will be issued to align the voltage with the valid ranges. The RPM aggregates all parameters for the specific regulator, the voltage will be adjusted and the "enabled" state will be "off" - and the regulator is turned off. This patch addresses this problem by caching the requested enable state, voltage and load and send the parameters in a batch, depending on the enable state - effectively delaying the voltage request for disabled regulators. Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-22regulator: wm831x-dcdc: Convert to use regulator_linear_range for wm831x_buckvAxel Lin1-30/+9
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-22regulator: twl: Use of_device_get_match_data()Axel Lin1-6/+1
Use of_device_get_match_data() to simplify the code a bit. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-22regulator: arizona-ldo1: Convert to use regulator_linear_range for ldo1_hcAxel Lin1-28/+9
Signed-off-by: Axel Lin <[email protected]> Acked-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-01-18regulator: lochnagar: Add missing MODULE_DEVICE_TABLECharles Keepax1-1/+2
Add the missing MODULE_DEVICE_TABLE and remove the comma from the separator on the end of the of_device_id array. Signed-off-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>