summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65219-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: tps65219: Fix matching interrupts for their regulatorsKrzysztof Kozlowski2023-05-091-3/+3
| | | | | | | | | | | | | | | | | | | | The driver's probe() first registers regulators in a loop and then in a second loop passes them as irq data to the interrupt handlers. However the function to get the regulator for given name tps65219_get_rdev_by_name() was a no-op due to argument passed by value, not pointer, thus the second loop assigned always same value - from previous loop. The interrupts, when fired, where executed with wrong data. Compiler also noticed it: drivers/regulator/tps65219-regulator.c: In function ‘tps65219_get_rdev_by_name’: drivers/regulator/tps65219-regulator.c:292:60: error: parameter ‘dev’ set but not used [-Werror=unused-but-set-parameter] Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Cc: <stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com Link: https://lore.kernel.org/r/20230507144656.192800-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org
* regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.15 and 6.1Douglas Anderson2023-03-201-0/+1
| | | | | | | | | | 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.15 but did exist in Linux 6.1. Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.6.Ibc8a86ddd5055ebbbe487a529199db7b36ccad1a@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: use generic set_bypass()Jerome Neanne2023-02-031-19/+1
| | | | | | | | | | | | | | Due to wrong interpretation of the specification, custom implementation was used instead of standard regmap helper. LINK: https://lore.kernel.org/all/c2014039-f1e8-6976-33d6-52e2dd4e7b66@baylibre.com/ Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Regulator does NOT require to be off to be switched to bypass mode. Signed-off-by: Jerome Neanne <jneanne@baylibre.com> Link: https://lore.kernel.org/r/20230203140119.13029-1-jneanne@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: use IS_ERR() to detect an error pointerRandy Dunlap2023-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix pointer comparison to integer warning from gcc & sparse: GCC: ../drivers/regulator/tps65219-regulator.c:370:26: warning: ordered comparison of pointer with integer zero [-Wextra] 370 | if (rdev < 0) { | ^ sparse warning: drivers/regulator/tps65219-regulator.c:370:26: sparse: error: incompatible types for operation (<): drivers/regulator/tps65219-regulator.c:370:26: sparse: struct regulator_dev *[assigned] rdev drivers/regulator/tps65219-regulator.c:370:26: sparse: int Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jerome Neanne <jneanne@baylibre.com> Cc: Tony Lindgren <tony@atomide.com> Cc: linux-omap@vger.kernel.org Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230114185736.2076-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: Report regulator name if devm_regulator_register failsWadim Egorov2022-12-251-1/+1
| | | | | | | | | Make the error message more useful by reporting the actual regulator name if devm_regulator_register() fails. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Link: https://lore.kernel.org/r/20221214153409.1270213-1-w.egorov@phytec.de Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: Fix is_enabled checking in tps65219_set_bypassAxel Lin2022-09-261-4/+2
| | | | | | | | | | Testing .enable cannot tell if a regulator is enabled or not, check return value of .is_enabled() instead. Also remove unneeded ret variable. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20220919122353.384171-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: Fix .bypass_val_on settingAxel Lin2022-09-091-1/+0
| | | | | | | | | | | The .bypass_val_on setting does not match the .bypass_mask setting, so the .bypass_mask bit will never get set. Fix it by removing .bypass_val_on setting, the regulator_set_bypass_regmap and regulator_get_bypass_regmap helpers will use rdev->desc->bypass_mask as val_on if the val_on is 0. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20220828120153.1512508-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: tps65219: change tps65219_regulator_irq_types to staticYang Yingliang2022-08-281-1/+1
| | | | | | | | | tps65219_regulator_irq_types is only used in tps65219-regulator.c now, change it to static. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220826061941.1814723-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: drivers: Remove unnecessary print function dev_err()Yang Li2022-08-251-4/+2
| | | | | | | | | | | The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1986 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220825070438.128093-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: drivers: Add TI TPS65219 PMIC regulators supportJerome Neanne2022-08-231-0/+416
The regulators set consists of 3 bucks DCDCs and 4 LDOs. The output voltages are configurable and are meant to supply power to the main processor and other components. Validation: Visual check: cat /sys/kernel/debug/regulator/regulator_summary Validation: userspace-consumer and virtual-regulator required to test further Enable/Disable: cat /sys/devices/platform/userspace-consumer-VDDSHV_SD_IO_PMIC/state echo disabled > /sys/devices/platform/ userspace-consumer-VDDSHV_SD_IO_PMIC/state echo enabled > /sys/devices/platform/ userspace-consumer-VDDSHV_SD_IO_PMIC/state Change voltage: cat /sys/devices/platform/regulator-virtual-ldo1/min_microvolts echo 1000000 > /sys/devices/platform/regulator-virtual-ldo1/ min_microvolts echo 3000000 > /sys/devices/platform/regulator-virtual-ldo1/ max_microvolts Signed-off-by: Jerome Neanne <jneanne@baylibre.com> Link: https://lore.kernel.org/r/20220805121852.21254-9-jneanne@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>