Age | Commit message (Collapse) | Author | Files | Lines |
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Kunihiko Hayashi <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
Add the DT binding document for max77650 regulators.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
This driver also supports RK805 now.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Charles Keepax <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
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]>
|