summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* regulator: Drop obsolete dependencies on COMPILE_TESTJean Delvare2022-11-246-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. As a minor optimization, this also lets us drop several occurrences of of_match_ptr(), __maybe_unused and some ifdef guarding, as we now know what all of this will resolve to, we might as well save cpp some work. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Icenowy Zheng <icenowy@aosc.io> Link: https://lore.kernel.org/r/20221124144708.64371b98@endymion.delvare Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pv88080-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-241-3/+3
| | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-555-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: pfuze100-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-241-3/+3
| | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-554-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: isl6271a-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-241-3/+3
| | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-543-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-241-3/+3
| | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-542-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: act8865-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-241-3/+3
| | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-539-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: qcom-rpmh: Add support for PM8550Mark Brown2022-11-242-2/+105
|\ | | | | | | | | | | Merge series from Abel Vesa <abel.vesa@linaro.org>: This patchset adds regulator support for the new Qualcomm PM8550 PMIC.
| * regulator: qcom-rpmh: Add support for PM8550 regulatorsAbel Vesa2022-11-231-0/+81
| | | | | | | | | | | | | | | | | | | | | | Add the rpmh regulators found in PM8550 PMIC and its variants, along with their compatibles and configuration data. They also contain some FT-SMPS 525, so add their configuration as well. Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20221123153638.721254-3-abel.vesa@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * regulator: dt-bindings: qcom,rpmh: Add compatible for PM8550Abel Vesa2022-11-231-2/+24
| | | | | | | | | | | | | | | | Add compatible string for PM8550 used in SM8550 boards. Signed-off-by: Abel Vesa <abel.vesa@linaro.org> Link: https://lore.kernel.org/r/20221123153638.721254-2-abel.vesa@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: ROHM BDxxxxx minor print improvementsMark Brown2022-11-234-81/+57
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Matti Vaittinen <mazziesaccount@gmail.com>: Minor (printing) improvements for ROHM regulator drivers. This series: - Drops an unnecessary info print from bd718x7. (Added a fixes tag for this but not really sure if worth adding to stable) - Convert the ROHM BDxxxxx PMIC regulator drivers to use dev_err_probe(). - Change the probe logic for bd718x7 to favor the more usual devm-style where errors are returned immediately.
| * | regulator: bd718x7: Use dev_err_probe()Matti Vaittinen2022-11-231-32/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 BD718x7 regulator driver to use the dev_err_probe() when returned error is not hard-coded constant. NOTE: This commit also changes the error handling path to return immediately from a spot where the error is spotted instead of using a single point of exit. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/fee54c2d04bb41b51381e31523f9ed31575206d2.1669203610.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regulator: bd71815: bd71828: bd9576: Use dev_err_probe()Matti Vaittinen2022-11-233-47/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | regulator: bd718x7: Drop unnecessary info printMatti Vaittinen2022-11-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A device-tree node name was printed when bd718x7 driver's feedback-loop feature was developed. This print was accidentally left in driver. The info-level print just pollutes the log. Drop unnecessary pr_info() Fixes: d2ad981151b3 ("regulator: bd718x7: Support external connection to scale voltages") Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/33fd99abf2451999938fef4ba6cf7b3f19e9b992.1669203610.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: tps65023-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-560-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: tps62360-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-558-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: max8973-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-552-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: max8660: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-550-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: ltc3589: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-547-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: lp872x: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-545-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | | regulator: ad5398: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-231-3/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-540-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: core: use kfree_const() to free space conditionallyWang ShaoBo2022-11-231-1/+1
|/ | | | | | | | | | | Use kfree_const() to free supply_name conditionally in create_regulator() as supply_name may be allocated from kmalloc() or directly from .rodata section. Fixes: 87fe29b61f95 ("regulator: push allocations in create_regulator() outside of lock") Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com> Link: https://lore.kernel.org/r/20221123034616.3609537-1-bobo.shaobowang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'i2c/client_device_id_helper-immutable' of ↵Mark Brown2022-11-232-0/+15
|\ | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into regulator-6.2 so we can apply I2C API fixups.
| * i2c: core: Introduce i2c_client_get_device_id helper functionAngel Iglesias2022-11-142-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces new helper function to aid in .probe_new() refactors. In order to use existing i2c_get_device_id() on the probe callback, the device match table needs to be accessible in that function, which would require bigger refactors in some drivers using the deprecated .probe callback. This issue was discussed in more detail in the IIO mailing list. Link: https://lore.kernel.org/all/20221023132302.911644-11-u.kleine-koenig@pengutronix.de/ Suggested-by: Nuno Sá <noname.nuno@gmail.com> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* | regulator: tps6286x-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-559-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: tps51632-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-557-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: rpi-panel-attiny-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-556-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: pca9450-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-553-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8952: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-551-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max8649: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-549-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: max1586: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-548-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: lp8755: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-546-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: lp3972: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-544-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: da9121-regulator: Convert to i2c's .probe_new()Uwe Kleine-König2022-11-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-for-MFD-by: Lee Jones <lee@kernel.org> Acked-for-Backlight-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-541-uwe@kleine-koenig.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()Peng Wu2022-11-221-1/+1
| | | | | | | | | | | | | | | | | | The regulator_get() function never returns NULL. It returns error pointers. Fixes: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Peng Wu <wupeng58@huawei.com> Link: https://lore.kernel.org/r/20221122082242.82937-1-wupeng58@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: arizona-micsupp: Don't use a common regulator nameRichard Fitzgerald2022-11-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Arizona and Madera codecs all have a datasheet name of "MICVDD" for the regulator output. But future codecs with a regulator that can be controlled by this driver have different naming convention for the output of the regulator. Move the setting of the supply name from arizona_micsupp_common_init() to arizona_micsupp_probe() and madera_micsupp_probe(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221109165331.29332-8-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: arizona-micsupp: Don't hardcode use of ARIZONA definesRichard Fitzgerald2022-11-221-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Madera support was added to this driver the code was left using ARIZONA_* defines. This wasn't causing any problem because those defines just happened to have the same value as the equivalent MADERA_* defines. But it is not ideal to assume this, and future devices that can share this driver do not have the same register map. Fix the code to refer to the register data in struct regulator_desc. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221109165331.29332-7-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: Add of_regulator_bulk_get_all()Mark Brown2022-11-182-0/+100
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Corentin Labbe <clabbe@baylibre.com>: This adds a new regulator_bulk_get_all() which grab all supplies properties in a DT node, for use in implementing generic handling for things like MDIO PHYs where the physical standardisation of the bus does not extend to power supplies.
| * | regulator: Add of_regulator_bulk_get_allCorentin Labbe2022-11-182-0/+100
| |/ | | | | | | | | | | | | | | | | | | It work exactly like regulator_bulk_get() but instead of working on a provided list of names, it seek all consumers properties matching xxx-supply. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Link: https://lore.kernel.org/r/20221115073603.3425396-2-clabbe@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | lib/test_linear_ranges: Use LINEAR_RANGE()Matti Vaittinen2022-11-161-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | New initialization macro for linear ranges was added. Slightly simplify the test code by using this macro - and at the same time also verify the macro is working as intended. Use the newly added LINEAR_RANGE() initialization macro for linear range test. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/Y3R13IRrs+x5PcZ4@dc75zzyyyyyyyyyyyyydt-3.rev.dnainternet.fi Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: dt-bindings: qcom,rpmh: clean up example indentationJohan Hovold2022-11-161-6/+4
| | | | | | | | | | | | | | | | | | | | | | Remove a line break and increase indentation of the continuation line to avoid having the 'regulator-allowed-modes' example be reproduced verbatim with four-spaces indentation (instead of a tab, which is still too little) in devicetree sources. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20221116102054.4673-2-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: qcom-rpmh: Fix PMR735a S3 regulator specKonrad Dybcio2022-11-161-1/+1
| | | | | | | | | | | | | | | | | | PMR735a has a wider range than previously defined. Fix it. Fixes: c4e5aa3dbee5 ("regulator: qcom-rpmh: Add PM7325/PMR735A regulator support") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20221110210706.80301-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()Yang Yingliang2022-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I got the the following report: OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /i2c/pmic@62/regulators/exten In of_get_regulator(), the node is returned from of_parse_phandle() with refcount incremented, after using it, of_node_put() need be called. Fixes: 69511a452e6d ("regulator: map consumer regulator based on device tree") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221115091508.900752-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: qcom_smd: Fix PMR735a S3 regulator specKonrad Dybcio2022-11-101-1/+10
| | | | | | | | | | | | | | | | | | PMR735a has a wider range than previously defined. Fix it. Fixes: 0cda8c43aa24 ("regulator: qcom_smd: Add PMR735a regulators") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20221110121225.9216-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: qcom,smd: Document PMR735aKonrad Dybcio2022-11-091-0/+3
| | | | | | | | | | | | | | | | | | | | PMR735a also appears to be bundled with some SMD RPM SoCs. Document it. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221109110846.45789-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: qcom_smd: Add PMR735a regulatorsKonrad Dybcio2022-11-092-0/+26
| | | | | | | | | | | | | | | | | | | | PMR735a is already supported in the RPMH regulator driver, but there are cases where it's bundled with SMD RPM SoCs. Port it over to qcom_smd-regulator to enable usage in such cases. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20221109110846.45789-2-konrad.dybcio@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: Add DT support for regulator-output connectorsMark Brown2022-11-037-43/+169
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Zev Weiss <zev@bewilderbeest.net>: This series adds support for userspace-controlled regulator-supplied power outputs [2]. This is an important feature for some kinds of BMC (baseboard management controller) systems where the BMC provides an operator with manual control of a set of DC power outputs. As in a broadly similar patchset that was recently almost merged [0], this takes the approach of providing support by extending the existing userspace-consumer regulator driver. A couple questions about the userspace-consumer driver came up along the way, however. First, how (if at all) is it currently being used? It appears the last in-tree use of it was removed a bit over two years ago in commit 9d3239147d6d ("ARM: pxa: remove Compulab pxa2xx boards"). Aside from just adding DT support I've made a couple small tweaks to the driver in patch 3 that I hope are compatible with any current usage, but without any extant examples to look at it's kind of hard to say. Second, how critical is its support for controlling multiple regulators? (i.e. its use of regulator_bulk_data and friends instead of a single struct regulator.) As far as I can see every in-tree use of it that's ever existed has used num_supplies = 1. If it's not important to retain, patch 1 of this series could be supplanted by one that instead simplifies the driver slightly by removing that functionality. The DT binding added in patch 2 is essentially identical to one I posted in a previous patchset that had an R-B from Rob [1], but has had some minor rewording and been moved from the extcon subsystem to the regulator subsystem.
| * | regulator: userspace-consumer: Handle regulator-output DT nodesZev Weiss2022-11-032-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to adding some fairly simple OF support code, we make some slight adjustments to the userspace-consumer driver to properly support use with regulator-output hardware: - We now do an exclusive get of the supply regulators so as to prevent regulator_init_complete_work from automatically disabling them. - Instead of assuming that the supply is initially disabled, we now query its state to determine the initial value of drvdata->enabled. Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20221031233704.22575-4-zev@bewilderbeest.net Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regulator: Add regulator-output bindingZev Weiss2022-11-031-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This describes a power output supplied by a regulator, such as a power outlet on a power distribution unit (PDU). Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20221031233704.22575-3-zev@bewilderbeest.net Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regulator: devres: Add devm_regulator_bulk_get_exclusive()Zev Weiss2022-11-034-36/+76
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | We had an exclusive variant of the devm_regulator_get() API, but no corresponding variant for the bulk API; let's add one now. We add a generalized version of the existing regulator_bulk_get() function that additionally takes a get_type parameter and redefine regulator_bulk_get() in terms of it, then do similarly with devm_regulator_bulk_get(), and finally add the new devm_regulator_bulk_get_exclusive(). Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Link: https://lore.kernel.org/r/20221031233704.22575-2-zev@bewilderbeest.net Signed-off-by: Mark Brown <broonie@kernel.org>
* | Add support for Richtek RT6190 36V 4-wwtich regulatorMark Brown2022-11-024-0/+586
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from cy_huang <u0084500@gmail.com>: The RT6190 is a 4-switch Buck-Boost controller designed for USB power delivery (USB PD). It operates with wide input voltage range from 4.5V to 36V, and the output voltage can be programmable between 3V and 36V. It implements peak current mode control mechanism to deliver up to 100W power with the programmable constant voltage and constant current output. It also has built-in charge pumps for driving external low-cost N-MOSFETs to control the power path.