summaryrefslogtreecommitdiff
path: root/drivers/regulator/bd71828-regulator.c
AgeCommit message (Collapse)Author
2024-05-16regulator: bd71828: Don't overwrite runtime voltagesMatti Vaittinen
Some of the regulators on the BD71828 have common voltage setting for RUN/SUSPEND/IDLE/LPSR states. The enable control can be set for each state though. The driver allows setting the voltage values for these states via device-tree. As a side effect, setting the voltages for SUSPEND/IDLE/LPSR will also change the RUN level voltage which is not desired and can break the system. The comment in code reflects this behaviour, but it is likely to not make people any happier. The right thing to do is to allow setting the enable/disable state at SUSPEND/IDLE/LPSR via device-tree, but to disallow setting state specific voltages for those regulators. BUCK1 is a bit different. It only shares the SUSPEND and LPSR state voltages. The former behaviour of allowing to silently overwrite the SUSPEND state voltage by LPSR state voltage is also changed here so that the SUSPEND voltage is prioritized over LPSR voltage. Prevent setting PMIC state specific voltages for regulators which do not support it. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Fixes: 522498f8cb8c ("regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators") Link: https://msgid.link/r/e1883ae1e3ae5668f1030455d4750923561f3d68.1715848512.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08regulator: bd71828: Drop useless headerLinus Walleij
The bd71828 includes the legacy header <linux/gpio.h> for no reason, drop the include. The documentation mentions GPIO but there is no usage of the GPIO namespace. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230808-descriptors-regulator-v1-10-939b5e84dd18@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.4 and 5.10Douglas Anderson
This follows on the change ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14") but changes regulators didn't exist in Linux 5.4 but did exist in Linux 5.10. Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.4.I01f21c98901641a009890590ddc1354c0f294e5e@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-23regulator: bd71815: bd71828: bd9576: Use dev_err_probe()Matti Vaittinen
The dev_err_probe() has (at least) following benefits over dev_err() when printing an error print for a failed function call at a device driver probe: - Omit error level print if error is 'EPRBE_DEFER' - Standardized print format for returned error - return the error value allowing shortening calls like: if (ret) { dev_err(...); return ret; } to if (ret) return dev_err_probe(...); Convert the ROHM BD71828, ROHM BD71815 and ROHM BD9576 regulator drivers to use the dev_err_probe() when returned error is not hard-coded constant. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/0b644da4a8f58558ffe474d2593f85c46de2f965.1669203610.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14regulator: bd718x7, bd71828: Use ramp-delay helperMatti Vaittinen
Use generic regamp ramp-delay helper function instead of implementing own. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-01-05regulator: ROHM bd7xxxx: Do not depend on parent driver dataMatti Vaittinen
The ROHM PMIC regulator drivers only need the regmap pointer from the parent device. Regmap can be obtained via dev_get_regmap() so do not require parent to populate driver data for that. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210105130221.GA3438042@localhost.localdomain Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-08regulator: use linear_ranges helperMatti Vaittinen
Change the regulator helpers to use common linear_ranges code. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-20regulator: bd71828: remove get_voltage operationMatti Vaittinen
Simplify LDO6 voltage getting on BD71828 by removing the get_voltage call-back and providing the fixed voltage in regulator_desc instead Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Suggested-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191219113444.GA28299@localhost.localdomain Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-17regulator: bd71828: Basic support for ROHM bd71828 PMIC regulatorsMatti Vaittinen
ROHM BD71828 is a power management IC containing 7 bucks and 7 LDOs. Bucks 1,2,6 and 7 can be assigned to a regulator group controlled by run-levels. Eg. Voltages and enable/disable statuses for specific run-levels (run0 to run3) can be set via register interface and run level changes can then be done either via I2C or GPIO. This initial commit does not support assigning bucks to be controlled via run-levels but only allows them to be individually controlled. LDO5 voltage can also be controlled by GPIO2 pin and register interfaces but this driver only supports the control via register. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/5b1c4a22c7945e97ff2a7924abfeb3239043f8eb.1576054779.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>