summaryrefslogtreecommitdiff
path: root/drivers/regulator/bd71815-regulator.c
AgeCommit message (Collapse)Author
2023-08-08regulator: bd71815: Drop useless headerLinus Walleij
The bd71815 regulator driver includes the legacy header <linux/gpio.h> for no reason, it is already using the proper <linux/gpio/consumer.h> include. Drop the include. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230808-descriptors-regulator-v1-11-939b5e84dd18@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.10 and 5.15Douglas 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.10 but did exist in Linux 5.15. Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.5.Ia0e6d859bdfe42ea5c187fb1eb4705c1b5ea23a1@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-11regulator: Use of_property_present() for testing DT property presenceRob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144721.1544756-1-robh@kernel.org 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>
2022-09-05regulator: bd71815: switch to using devm_fwnode_gpiod_get()Dmitry Torokhov
I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-8-b29adfb27a6c@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04regulator: bd71815: Use defined mask valuesMatti Vaittinen
Consistently use the defines for buck control mask values. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/YVqpujZLZmaiqwe8@fedora Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-08regulator: bd71815: Get rid of struct bd71815_pmicAxel Lin
The content of bd71815_regulators is never changed, no need to duplicate it, thus remove descs[BD71815_REGULATOR_CNT]. The *regmap, *dev and *rdev[BD71815_REGULATOR_CNT] are not really needed. The *gps is unused. Thus the struct bd71815_pmic can be removed. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210607143002.1600017-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-27regulator: bd71815: fix platform_no_drv_owner.cocci warningsZou Wei
./drivers/regulator/bd71815-regulator.c:644: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 Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Message-Id: <1622109244-54739-1-git-send-email-zou_wei@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18regulator: bd71815: Fix missing include filesAxel Lin
Include linux/of.h and linux/gpio/consumer.h to fix below errors: error: implicit declaration of function ‘of_match_ptr’ error: implicit declaration of function ‘devm_gpiod_get_from_of_node’ Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210518114843.1495152-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14regulator: Support ROHM BD71815 regulatorsMatti Vaittinen
Support voltage control for regulators on ROHM BD71815 PMIC. ROHM BD71815 contains 5 bucks, 7 LDOs and a boost (intended for LED). Bucks 1 and 2 support HW state based voltage level and enable states. Other regulators support HW state based enable states. All bucks and LDOs 1-5 allow voltage changes for RUN state and LDO4 can be enabled/disabled via GPIO. LDO3 does support changing between two predetermined voltages by using a GPIO but this functionality is not included in this commit. This work is derived from driver originally written by Tony Luo <luofc@embedinfo.com> - although not much of original work is left. 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>