summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2025-07-03regulator: gpio: Fix the out-of-bounds access to drvdata::gpiodsManivannan Sadhasivam
drvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But the memory is allocated for only one pointer. This will lead to out-of-bounds access later in the code if 'config::ngpios' is > 1. So fix the code to allocate enough memory to hold 'config::ngpios' of GPIO descriptors. While at it, also move the check for memory allocation failure to be below the allocation to make it more readable. Cc: stable@vger.kernel.org # 5.0 Fixes: d6cd33ad7102 ("regulator: gpio: Convert to use descriptors") Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20250703103549.16558-1-mani@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-30regulator: mp886x: Fix ID table driver_dataJisheng Zhang
Currently, the driver_data of the i2c ID table is wrong, so it won't work if any mp886x user makes use of the ID table. Fortunately, there's no such user in upstream source code, we can fix the issue by using different ID table entry for mp8867 and mp8869. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Link: https://patch.msgid.link/20250629095918.912-1-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-30regulator: sy8824x: Fix ID table driver_dataJisheng Zhang
Currently, the driver_data of the i2c ID table is wrong, so it won't work if any sy8824x user makes use of the ID table. Fortunately, there's no such user in upstream source code, we can fix the issue by using different ID table entry for sy8824c, sy8824e, sy20276 and sy20278. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Link: https://patch.msgid.link/20250629095905.898-1-jszhang@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-29regulator: tps65219: Fix devm_kmalloc size allocationShree Ramamoorthy
In probe(), two arrays of structs are allocated with the devm_kmalloc() function, but the memory size of the allocations were given as the arrays' length (pmic->common_irq_size for the first call and pmic->dev_irq_size for the second devm_kmalloc call). The memory size should have been the total memory needed. This led to a heap overflow when the struct array was used. The issue was first discovered with the PocketBeagle2 and BeaglePlay. The common and device-specific structs are now allocated one at a time within the loop. Fixes: 38c9f98db20a ("regulator: tps65219: Add support for TPS65215 Regulator IRQs") Reported-by: Dhruva Gole <d-gole@ti.com> Closes: https://lore.kernel.org/all/20250619153526.297398-1-d-gole@ti.com/ Tested-by: Robert Nelson <robertcnelson@gmail.com> Acked-by: Andrew Davis <afd@ti.com> Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Reviewed-by: Nishanth Menon <nm@ti.com> Link: https://patch.msgid.link/20250620154541.2713036-1-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-29regulator: core: fix NULL dereference on unbind due to stale coupling dataAlessandro Carminati
Failing to reset coupling_desc.n_coupled after freeing coupled_rdevs can lead to NULL pointer dereference when regulators are accessed post-unbind. This can happen during runtime PM or other regulator operations that rely on coupling metadata. For example, on ridesx4, unbinding the 'reg-dummy' platform device triggers a panic in regulator_lock_recursive() due to stale coupling state. Ensure n_coupled is set to 0 to prevent access to invalid pointers. Signed-off-by: Alessandro Carminati <acarmina@redhat.com> Link: https://patch.msgid.link/20250626083809.314842-1-acarmina@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-16regulator: fan53555: add enable_time support and soft-start timesHeiko Stuebner
The datasheets for all the fan53555 variants (and clones using the same interface) define so called soft start times, from enabling the regulator until at least some percentage of the output (i.e. 92% for the rk860x types) are available. The regulator framework supports this with the enable_time property but currently the fan53555 driver does not define enable_times for any variant. I ran into a problem with this while testing the new driver for the Rockchip NPUs (rocket), which does runtime-pm including disabling and enabling a rk8602 as needed. When reenabling the regulator while running a load, fatal hangs could be observed while enabling the associated power-domain, which the regulator supplies. Experimentally setting the regulator to always-on, made the issue disappear, leading to the missing delay to let power stabilize. And as expected, setting the enable-time to a non-zero value according to the datasheet also resolved the regulator-issue. The datasheets in nearly all cases only specify "typical" values, except for the fan53555 type 08. There both a typical and maximum value are listed - 40uS apart. For all typical values I've added 100uS to be on the safe side. Individual details for the relevant regulators below: - fan53526: The datasheet for all variants lists a typical value of 150uS, so make that 250uS with safety margin. - fan53555: types 08 and 18 (unsupported) are given a typical enable time of 135uS but also a maximum of 175uS so use that value. All the other types only have a typical time in the datasheet of 300uS, so give a bit margin by setting it to 400uS. - rk8600 + rk8602: Datasheet reports a typical value of 260us, so use 360uS to be safe. - syr82x + syr83x: All datasheets report typical soft-start values of 300uS for these regulators, so use 400uS. - tcs452x: Datasheet sadly does not report a soft-start time, so I've not set an enable-time Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20250606190418.478633-1-heiko@sntech.de Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()Dan Carpenter
There is a missing call to of_node_put() if devm_kcalloc() fails. Fix this by changing the code to use cleanup.h magic to drop the refcount. Fixes: 6b0cd72757c6 ("regulator: max20086: fix invalid memory access") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aDVRLqgJWMxYU03G@stanley.mountain Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-06Merge tag 'regulator-fix-v6.16-merge-window' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "A very minor fix that came in during the merge window, checking for I/O errors in the MAX14577 driver" * tag 'regulator-fix-v6.16-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: max14577: Add error check for max14577_read_reg()
2025-06-03Merge tag 'mfd-next-6.16' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Samsung Exynos ACPM: - Populate child platform devices from device tree data - Introduce a new API, 'devm_acpm_get_by_node()', for child devices to get the ACPM handle ROHM PMICs: - Add support for the ROHM BD96802 scalable companion PMIC to the BD96801 core driver - Add support for controlling the BD96802 using the BD96801 regulator driver - Add support to the BD96805, which is almost identical to the BD96801 - Add support to the BD96806, which is similar to the BD96802 Maxim MAX77759: - Add a core driver for the MAX77759 companion PMIC - Add a GPIO driver for the expander functions on the MAX77759 - Add an NVMEM driver to expose the non-volatile memory on the MAX77759 STMicroelectronics STM32MP25: - Add support for the STM32MP25 SoC to the stm32-lptimer - Add support for the STM32MP25 to the clocksource driver, handling new register access requirements - Add support for the STM32MP25 to the PWM driver, enabling up to two PWM outputs Broadcom BCM590xx: - Add support for the BCM59054 PMU - Parse the PMU ID and revision to support behavioral differences between chip revisions - Add regulator support for the BCM59054 Samsung S2MPG10: - Add support for the S2MPG10 PMIC, which communicates via the Samsung ACPM firmware instead of I2C Exynos ACPM: - Improve timeout detection reliability by using ktime APIs instead of a loop counter assumption - Allow PMIC access during late system shutdown by switching to 'udelay()' instead of a sleeping function - Fix an issue where reading command results longer than 8 bytes would fail - Silence non-error '-EPROBE_DEFER' messages during boot to clean up logs Exynos LPASS: - Fix an error handling path by switching to 'devm_regmap_init_mmio()' to prevent resource leaks - Fix a bug where 'exynos_lpass_disable()' was called twice in the remove function - Fix another resource leak in the probe's error path by using 'devm_add_action_or_reset()' Samsung SEC: - Handle the s2dos05, which does not have IRQ support, explicitly to prevent warnings - Fix the core driver to correctly handle errors from 'sec_irq_init()' instead of ignoring them STMPE-SPI: - Correct an undeclared identifier in the 'MODULE_DEVICE_TABLE' macro MAINTAINERS: - Adjust a file path for the Siemens IPC LED drivers entry to fix a broken reference Maxim Drivers: - Correct the spelling of "Electronics" in Samsung copyright headers across multiple files General: - Fix wakeup source memory leaks on device unbind for 88pm886, as3722, max14577, max77541, max77705, max8925, rt5033, and sprd-sc27xx drivers Samsung SEC Drivers: - Split the driver into a transport-agnostic core ('sec-core') and transport-specific ('sec-i2c', 'sec-acpm') modules to support non-I2C devices - Merge the 'sec-core' and 'sec-irq' modules to reduce memory consumption - Move internal APIs to a private header to clean up the public API - Improve code style by sorting includes, cleaning up headers, sorting device tables, and using helper macros like 'dev_err_probe()', 'MFD_CELL', and 'REGMAP_IRQ_REG' - Make regmap configuration for s2dos05/s2mpu05 explicit to improve clarity - Rework platform data and regmap instantiation to use OF match data instead of a large switch statement ROHM BD96801/2: - Prepare the driver for new models by separating chip-specific data into its own structure - Drop IC name prefix from IRQ resource names in both the MFD and regulator drivers for simplification Broadcom BCM590xx: - Refactor the regulator driver to store descriptions in a table to ease support for new chips - Rename BCM59056-specific data to prepare for the addition of other regulators - Use 'dev_err_probe()' for cleaner error handling Exynos ACPM: - Correct kerneldoc warnings and use the conventional 'np' argument name General MFD: - Convert 'aat2870' and 'tps65010' to use the per-client debugfs directory provided by the I2C core - Convert 'sm501', 'tps65010' and 'ucb1x00' to use the new GPIO line value setter callbacks - Constify 'regmap_irq_chip' and other structures in '88pm886' to move data to read-only sections BCM590xx: - Drop the unused "id" member from the 'bcm590xx' struct in preparation for a replacement Samsung SEC Core: - Remove forward declarations for functions that no longer exist SM501: - Remove the unused 'sm501_find_clock()' function New Compatibles: - Google: Add a PMIC child node to the 'google,gs101-acpm-ipc' binding - ROHM: Add new bindings for 'rohm,bd96802-regulator' and 'rohm,bd96802-pmic', and add compatibles for BD96805 and BD96806 - Maxim: Add new bindings for 'maxim,max77759-gpio', 'maxim,max77759-nvmem', and the top-level 'maxim,max77759' - STM: Add 'stm32mp25' compatible to the 'stm32-lptimer' binding - Broadcom: Add 'bcm59054' compatible - Atmel/Microchip: Add 'microchip,sama7d65-gpbr' and 'microchip,sama7d65-secumod' compatibles - Samsung: Add 's2mpg10' compatible to the 'samsung,s2mps11' MFD binding - MediaTek: Add compatibles for 'mt6893' (scpsys), 'mt7988-topmisc', and 'mt8365-infracfg-nao' - Qualcomm: Add 'qcom,apq8064-mmss-sfpb' and 'qcom,apq8064-sps-sic' syscon compatibles Refactoring & Cleanup: - Convert Broadcom BCM59056 devicetree bindings to YAML and split them into MFD and regulator parts - Convert the Microchip AT91 secumod binding to YAML - Drop unrelated consumer nodes from binding examples to reduce bloat - Correct indentation and style in various DTS examples" * tag 'mfd-next-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (81 commits) mfd: maxim: Correct Samsung "Electronics" spelling in copyright headers mfd: maxim: Correct Samsung "Electronics" spelling in headers mfd: sm501: Remove unused sm501_find_clock mfd: 88pm886: Constify struct regmap_irq_chip and some other structures dt-bindings: mfd: syscon: Add mediatek,mt8365-infracfg-nao mfd: sprd-sc27xx: Fix wakeup source leaks on device unbind mfd: rt5033: Fix wakeup source leaks on device unbind mfd: max8925: Fix wakeup source leaks on device unbind mfd: max77705: Fix wakeup source leaks on device unbind mfd: max77541: Fix wakeup source leaks on device unbind mfd: max14577: Fix wakeup source leaks on device unbind mfd: as3722: Fix wakeup source leaks on device unbind mfd: 88pm886: Fix wakeup source leaks on device unbind dt-bindings: mfd: Correct indentation and style in DTS example dt-bindings: mfd: Drop unrelated nodes from DTS example dt-bindings: mfd: syscon: Add qcom,apq8064-sps-sic dt-bindings: mfd: syscon: Add qcom,apq8064-mmss-sfpb mfd: stmpe-spi: Correct the name used in MODULE_DEVICE_TABLE dt-bindings: mfd: syscon: Add mt7988-topmisc mfd: exynos-lpass: Fix another error handling path in exynos_lpass_probe() ...
2025-05-27Merge tag 'regulator-v6.16' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "This is a very quiet release, there was no work on the core and a good chunk of the updates were the result of conversions to use newer GPIO APIs. We did gain support for Analog ADP5055 and TI TPS65214 devices, and there's a new restart handler for the PCA9450 which allows devices using it to be properly power cycled on reboot, but otherwise it's minor fixes and API updates" * tag 'regulator-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (24 commits) regulator: qcom_spmi: Constify struct spmi_voltage_range regulator: max8952: Correct Samsung "Electronics" spelling in copyright headers regulator: dt-bindings: mt6357: Drop fixed compatible requirement regulator: gpio: Use dev_err_probe regulator: pca9450: Add restart handler regulator: da9121: Fix Wvoid-pointer-to-enum-cast warning regulator: tps65219: Add TI TPS65214 Regulator Support regulator: tps65219: Add support for TPS65215 Regulator IRQs regulator: tps65219: Add support for TPS65215 regulator resources regulator: tps65219: Update struct names regulator: pf9453: convert to use maple tree register cache regulator: max20086: Change enable gpio to optional regulator: max20086: Fix MAX200086 chip id regulator: adp5055: Remove unneeded semicolon regulator: adp5055: remove duplicate device table regulator: adp5055: Add driver for adp5055 regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support regulator: don't compare raw GPIO descriptor pointers regulator: rpi-panel-attiny: use new GPIO line value setter callbacks regulator: rpi-panel-attiny: use lock guards for the state mutex ...
2025-05-26regulator: max14577: Add error check for max14577_read_reg()Wentao Liang
The function max14577_reg_get_current_limit() calls the function max14577_read_reg(), but does not check its return value. A proper implementation can be found in max14577_get_online(). Add a error check for the max14577_read_reg() and return error code if the function fails. Fixes: b0902bbeb768 ("regulator: max14577: Add regulator driver for Maxim 14577") Cc: stable@vger.kernel.org # v3.14 Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20250526025627.407-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-22Merge branches 'ib-firmware-mfd-6.16', 'ib-mfd-clocksource-pwm-6.16', ↵Lee Jones
'ib-mfd-gpio-nvmem-6.16', 'ib-mfd-regulator-6.16' and 'ib-mfd-regulator-6.16-1' into ibs-for-mfd-merged
2025-05-22regulator: bcm590xx: Add support for BCM59054 regulatorsArtur Weber
The BCM59056 and BCM59054 are very similar in terms of regulators. Add the register definitions for the BCM59054 and enable support for it in the driver. Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Reviewed-by: Stanislav Jakubek <stano.jakubek@gmail.com> Reviewed-by: Mark Brown <brooni@kernel.org> Link: https://lore.kernel.org/r/20250515-bcm59054-v9-8-14ba0ea2ea5b@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-22regulator: bcm590xx: Rename BCM59056-specific data as suchArtur Weber
Previously, the driver used the BCM590XX prefix for register data specific to the BCM59056. As we will be introducing other regulators to this driver as well, make the BCM59056-specific values use the BCM59056 prefix. Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Reviewed-by: Stanislav Jakubek <stano.jakubek@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20250515-bcm59054-v9-7-14ba0ea2ea5b@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-22regulator: bcm590xx: Store regulator descriptions in tableArtur Weber
Instead of filling in the regulator description programatically, store the data in a struct. This will make it a bit nicer to introduce support for other BCM590xx chips besides the BCM59056. To do this, add a new struct type, bcm590xx_reg_data, to store all of the necessary information. Drop the old IS_LDO, IS_GPLDO... macros in favor of the "type" field in this struct. Adapt the old bcm590xx_reg struct to the new types. Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Reviewed-by: Stanislav Jakubek <stano.jakubek@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20250515-bcm59054-v9-6-14ba0ea2ea5b@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-22regulator: bcm590xx: Use dev_err_probe for regulator register errorArtur Weber
Instead of calling dev_err() and returning PTR_ERR(...) separately, use a single "return dev_err_probe" statement. Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Reviewed-by: Stanislav Jakubek <stano.jakubek@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20250515-bcm59054-v9-5-14ba0ea2ea5b@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-19regulator: qcom_spmi: Constify struct spmi_voltage_rangeChristophe JAILLET
'struct spmi_voltage_range' are only modified at runtime to compile a field, n_voltages, that could be computed at compile time. So, simplify spmi_calculate_num_voltages() and compute n_voltages at compile time within the SPMI_VOLTAGE_RANGE macro. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 85437 26776 512 112725 1b855 drivers/regulator/qcom_spmi-regulator.o After: ===== text data bss dec hex filename 86857 24760 512 112129 1b601 drivers/regulator/qcom_spmi-regulator.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/ef2a4b6df61e19470ddf6cbd1f3ca1ce88a3c1a0.1747570556.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-14regulator: max20086: fix invalid memory accessCosmin Tanislav
max20086_parse_regulators_dt() calls of_regulator_match() using an array of struct of_regulator_match allocated on the stack for the matches argument. of_regulator_match() calls devm_of_regulator_put_matches(), which calls devres_alloc() to allocate a struct devm_of_regulator_matches which will be de-allocated using devm_of_regulator_put_matches(). struct devm_of_regulator_matches is populated with the stack allocated matches array. If the device fails to probe, devm_of_regulator_put_matches() will be called and will try to call of_node_put() on that stack pointer, generating the following dmesg entries: max20086 6-0028: Failed to read DEVICE_ID reg: -121 kobject: '\xc0$\xa5\x03' (000000002cebcb7a): is not initialized, yet kobject_put() is being called. Followed by a stack trace matching the call flow described above. Switch to allocating the matches array using devm_kcalloc() to avoid accessing the stack pointer long after it's out of scope. This also has the advantage of allowing multiple max20086 to probe without overriding the data stored inside the global of_regulator_match. Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com> Link: https://patch.msgid.link/20250508064947.2567255-1-demonsingur@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-13regulator: gpio: Use dev_err_probeNishanth Menon
During probe the gpio driver may not yet be available. Use dev_err_probe to provide just the pertinent log. Since dev_err_probe takes care of reporting the error value, drop the redundant ret variable while at it. Signed-off-by: Nishanth Menon <nm@ti.com> Link: https://patch.msgid.link/20250512185727.2907411-1-nm@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-12regulator: pca9450: Add restart handlerPaul Geurts
When restarting a CPU powered by the PCA9450 power management IC, it is beneficial to use the PCA9450 to power cycle the CPU and all its connected peripherals to start up in a known state. The PCA9450 features a cold start procedure initiated by an I2C command. Add a restart handler so that the PCA9450 is used to restart the CPU. The restart handler sends command 0x14 to the SW_RST register, initiating a cold reset (Power recycle all regulators except LDO1, LDO2 and CLK_32K_OUT) As the PCA9450 is a PMIC specific for the i.MX8M family CPU, the restart handler priority is set just slightly higher than imx2_wdt and the PSCI restart handler. This makes sure this restart handler takes precedence. Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com> Link: https://patch.msgid.link/20250505115936.1946891-1-paul.geurts@prodrive-technologies.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-10regulator: da9121: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski
'subvariant_id' is an enum, thus cast of pointer on 64-bit compile test with clang and W=1 causes: da9121-regulator.c:1132:24: error: cast to smaller integer type 'enum da9121_subvariant' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250509142448.257199-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add TI TPS65214 Regulator SupportShree Ramamoorthy
Add support for TPS65214 regulators (bucks and LDOs) to the TPS65219 Regulator Driver as the TPS65214/TPS65214/TPS65219 PMIC devices have significant register map overlap. TPS65214 is a Power Management IC with 3 Buck regulators (like TPS65215/TPS65219) and has 2 LDOs (like TPS65215). Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-5-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add support for TPS65215 Regulator IRQsShree Ramamoorthy
Isolate all changes involving regulator IRQ types: - Adding in TPS65215 resources - Organize what resources are common vs device-specific - How the chip_data uses these resource structs - Restructure the probe() for multi-PMIC support. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-4-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add support for TPS65215 regulator resourcesShree Ramamoorthy
Isolate all changes involving TPS65215 regulator desc and range resources. - 'chipid' will identify which PMIC to support, and the corresponding chip_data struct element to use in probe(). The chip_data struct is helpful for any new PMICs added to this driver. The goal is to add future PMIC info to necessary structs and minimize probe() function edits. - The probe() will now loop through common (overlapping) regulators first, then device-specific structs identified in the chip_data struct. - Add TI TPS65215 PMIC to the existing platform_device_id struct, so the regulator probe() can handle which PMIC chip_data information to use. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-3-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Update struct namesShree Ramamoorthy
Isolate changes that involve renaming to indicate this resource is only for TPS65219 or if it will be common for both devices. The renames are in preparation for adding TPS65215 support. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-2-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24regulator: bd96801: Support ROHM BD96806 PMICMatti Vaittinen
The ROHM BD96806 is from the software perspective almost identical to the ROHM BD96802. The main difference is different voltage tuning ranges. Add support differentiating these PMICs and provide correct voltages for both models. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/5d15660e0e71c70fda8df1694bec0e4fba7f251e.1744090658.git.mazziesaccount@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-24regulator: bd96801: Support ROHM BD96805 PMICMatti Vaittinen
The ROHM BD96805 is from the software perspective almost identical to the ROHM BD96801. The main difference is different voltage tuning ranges. Add support differentiating these PMICs and provide correct voltages for both models. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/eab1369557b14a9762c41a5429d1ac87a4644d9e.1744090658.git.mazziesaccount@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-24regulator: bd96801: Support ROHM BD96802Matti Vaittinen
The ROHM BD96802 PMIC is primarily intended to be used as a companion PMIC extending the capabilities of the BD96802 but it can be used on it's own as well. When used as a companion PMIC, the start-up and shut-down sequences are usually intitiated by the master PMIC using IF pins. The BD96802 looks from the digital interface point of view pretty much like a reduced version of BD96801. It includes only 2 BUCKs and provides the same error protection/detection mechanisms as the BD96801. Also, the voltage control logic is same up to the register addresses. Add support for controlling BD96802 using the BD96801 driver. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/2fb2d0d4997c32d18bfa32cea4564352c00eebc8.1744090658.git.mazziesaccount@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-24regulator: bd96801: Drop IC name from the IRQ resourcesMatti Vaittinen
The resources generated in the BD96801 MFD driver are only visible to the sub-drivers whose resource fields they are added. This makes abbreviating the resource name with the IC name pointless. It just adds confusion in those sub-drivers which do not really care the exact model that generates the IRQ but just want to know the purpose IRQ was generated for. Thus, as a preparatory fix to simplify adding support for ROHM BD96802 PMIC the IC name "bd96801-" prefix was dropped from the IRQ resource names. Adapt the regulator driver to this change. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/73ec2425655ab19c9f0cf990419641ad36561590.1744090658.git.mazziesaccount@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-24regulator: pf9453: convert to use maple tree register cacheBo Liu
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Bo Liu <liubo03@inspur.com> Link: https://patch.msgid.link/20250424010855.2662-1-liubo03@inspur.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-23regulator: max20086: Fixes chip id and enable gpioMark Brown
Merge series from João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com>: I'm working on integrating a system with a MAX20086 and noticed these small issues in the driver: the chip ID for MAX20086 is 0x30 and not 0x40. Also, in my use case, the enable pin is always enabled by hardware, so the enable GPIO isn't needed. Without these changes, the driver fails to probe.
2025-04-22regulator: max20086: Change enable gpio to optionalJoão Paulo Gonçalves
The enable pin can be configured as always enabled by the hardware. Make the enable gpio request optional so the driver doesn't fail to probe when `enable-gpios` property is not present in the device tree. Cc: stable@vger.kernel.org Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> Link: https://patch.msgid.link/20250420-fix-max20086-v1-2-8cc9ee0d5a08@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-22regulator: max20086: Fix MAX200086 chip idJoão Paulo Gonçalves
>From MAX20086-MAX20089 datasheet, the id for a MAX20086 is 0x30 and not 0x40. With the current code, the driver will fail on probe when the driver tries to identify the chip id from a MAX20086 device over I2C. Cc: stable@vger.kernel.org Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> Link: https://patch.msgid.link/20250420-fix-max20086-v1-1-8cc9ee0d5a08@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-14regulator: adp5055: Remove unneeded semicolonChen Ni
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the semantic patch at scripts/coccinelle/misc/semicolon.cocci. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://patch.msgid.link/20250414021950.3755819-1-nichen@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-10regulator: adp5055: remove duplicate device tableArnd Bergmann
When building with -Wunused-const-variable, gcc points out an device table that is not referenced anywhere: drivers/regulator/adp5055-regulator.c:346:34: error: unused variable 'adp5055_dt_ids' [-Werror,-Wunused-const-variable] 346 | static const struct of_device_id adp5055_dt_ids[] = { | ^~~~~~~~~~~~~~ The contents are the same as the second table in that file, so just remove this copy. Fixes: 147b2a96f24e ("regulator: adp5055: Add driver for adp5055") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20250410141006.866813-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-09Add support for ADP5055 triple buck regulator.Mark Brown
Merge series from Alexis Czezar Torreno <alexisczezar.torreno@analog.com>: Introduce a regulator driver support for ADP5055. The device combines 3 high performance buck regulators in a 43-termminal land grid array package. The device enables direct connection to high input voltages up to 18V with no preregulator. Channel 1 and 2 deliver a programmable output current of 3.5A or 7.5A or provide a single output with up to 14A in parallel operation. Channel 3 has a programmable output current of 1.5A or 3A.
2025-04-09gpio: don't compare raw GPIO descriptor pointersMark Brown
Merge series from Bartosz Golaszewski <brgl@bgdev.pl>: Handling of shared GPIOs in the kernel needs some improvements. Let's start with a simple change of not comparing GPIO descriptor pointers directly as there's nothing that guarantees that the same physical pin will always be represented by a single GPIO descriptor obtained by calling gpiod_get().
2025-04-09regulator: adp5055: Add driver for adp5055Alexis Czezar Torreno
Add ADI ADP5055 driver support. The device consists of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com> Link: https://patch.msgid.link/20250409-upstream-adp5055-v6-2-faa6e810deb1@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-09regulator: don't compare raw GPIO descriptor pointersBartosz Golaszewski
There's no API contract saying that two GPIO descriptor pointers obtained with a call to gpiod_get() (or one of the variants), that refer to the same physical GPIO pin, always point to the same structure. Use the dedicated comparator function. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250407-gpiod-is-equal-v1-2-7d85f568ae6e@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use new GPIO line valueMark Brown
Merge series from Bartosz Golaszewski <brgl@bgdev.pl>: struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. We're in the process of converting all GPIO drivers to using the new API. This series converts the only GPIO controller under drivers/regulator/ and - while at it - refactors the code a bit.
2025-04-08regulator: rpi-panel-attiny: use new GPIO line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-4-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use lock guards for the state mutexBartosz Golaszewski
Use mutex lock guards from linux/cleanup.h to simplify the driver code. Note that ret must be initialized in order to avoid a build warning as scoped_guard() is implemented as a for loop. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-3-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use devres for mutex managementBartosz Golaszewski
Simplify the probe() code and remove the remove() callback by using devres to manage the mutex resources. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-2-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: don't double-check GPIO rangeBartosz Golaszewski
GPIO core already checks GPIO ranges, there's no need to check it again in the set() callback. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-1-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-07regulator: s5m8767: Convert to GPIO descriptorsMark Brown
Merge series from From git@z Thu Jan 1 00:00:00 1970 Peng Fan <peng.fan@nxp.com>: Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors. Then drop the usage of 'of_gpio.h' which should be deprecated. Based on commit 84618d5e31cf ("regulator: max8997: Convert to GPIO descriptors") as a reference to make the changes. With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity, the polarity will be active-high, even if exynos5250 spring DTS wrongly use active-low polarity. So using GPIO descriptors, it should work as before.
2025-04-07regulator: pf9453: Improve documentation for ↵Yang Li
pf9453_regulator_set_ramp_delay_regmap The function pf9453_regulator_set_ramp_delay_regmap lacked detailed parameter descriptions and return value explanations in its documentation. This patch improves the documentation by adding specific details about the parameters, their usage, and the return values, enhancing clarity for developers. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=20168 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://patch.msgid.link/20250407064532.22680-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-07regulator: s5m8767: Convert to GPIO descriptorsPeng Fan
Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors. Then drop the usage of 'of_gpio.h' which should be deprecated. Based on commit 84618d5e31cf ("regulator: max8997: Convert to GPIO descriptors") as a reference to make the changes. With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity, the polarity will be active-high, even if exynos5250 spring DTS wrongly use active-low polarity. So using GPIO descriptors, it should work as before. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250327004945.563765-2-peng.fan@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-02Merge tag 'objtool-urgent-2025-04-01' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Ingo Molnar: "These are objtool fixes and updates by Josh Poimboeuf, centered around the fallout from the new CONFIG_OBJTOOL_WERROR=y feature, which, despite its default-off nature, increased the profile/impact of objtool warnings: - Improve error handling and the presentation of warnings/errors - Revert the new summary warning line that some test-bot tools interpreted as new regressions - Fix a number of objtool warnings in various drivers, core kernel code and architecture code. About half of them are potential problems related to out-of-bounds accesses or potential undefined behavior, the other half are additional objtool annotations - Update objtool to latest (known) compiler quirks and objtool bugs triggered by compiler code generation - Misc fixes" * tag 'objtool-urgent-2025-04-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) objtool/loongarch: Add unwind hints in prepare_frametrace() rcu-tasks: Always inline rcu_irq_work_resched() context_tracking: Always inline ct_{nmi,irq}_{enter,exit}() sched/smt: Always inline sched_smt_active() objtool: Fix verbose disassembly if CROSS_COMPILE isn't set objtool: Change "warning:" to "error: " for fatal errors objtool: Always fail on fatal errors Revert "objtool: Increase per-function WARN_FUNC() rate limit" objtool: Append "()" to function name in "unexpected end of section" warning objtool: Ignore end-of-section jumps for KCOV/GCOV objtool: Silence more KCOV warnings, part 2 objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions objtool: Fix segfault in ignore_unreachable_insn() objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv() objtool, lkdtm: Obfuscate the do_nothing() pointer objtool, regulator: rk808: Remove potential undefined behavior in rk806_set_mode_dcdc() objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store() objtool, panic: Disable SMAP in __stack_chk_fail() ...
2025-04-01Merge tag 'char-misc-6.15-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc / IIO driver updates from Greg KH: "Here is the big set of char, misc, iio, and other smaller driver subsystems for 6.15-rc1. Lots of stuff in here, including: - loads of IIO changes and driver updates - counter driver updates - w1 driver updates - faux conversions for some drivers that were abusing the platform bus interface - coresight driver updates - rust miscdevice binding updates based on real-world-use - other minor driver updates All of these have been in linux-next with no reported issues for quite a while" * tag 'char-misc-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (292 commits) samples: rust_misc_device: fix markup in top-level docs Coresight: Fix a NULL vs IS_ERR() bug in probe misc: lis3lv02d: convert to use faux_device tlclk: convert to use faux_device regulator: dummy: convert to use the faux device interface bus: mhi: host: Fix race between unprepare and queue_buf coresight: configfs: Constify struct config_item_type doc: iio: ad7380: describe offload support iio: ad7380: add support for SPI offload iio: light: Add check for array bounds in veml6075_read_int_time_ms iio: adc: ti-ads7924 Drop unnecessary function parameters staging: iio: ad9834: Use devm_regulator_get_enable() staging: iio: ad9832: Use devm_regulator_get_enable() iio: gyro: bmg160_spi: add of_match_table dt-bindings: iio: adc: Add i.MX94 and i.MX95 support iio: adc: ad7768-1: remove unnecessary locking Documentation: ABI: add wideband filter type to sysfs-bus-iio iio: adc: ad7768-1: set MOSI idle state to prevent accidental reset iio: adc: ad7768-1: Fix conversion result sign iio: adc: ad7124: Benefit of dev = indio_dev->dev.parent in ad7124_parse_channel_config() ...
2025-04-01Merge tag 'mm-nonmm-stable-2025-03-30-18-23' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: - The series "powerpc/crash: use generic crashkernel reservation" from Sourabh Jain changes powerpc's kexec code to use more of the generic layers. - The series "get_maintainer: report subsystem status separately" from Vlastimil Babka makes some long-requested improvements to the get_maintainer output. - The series "ucount: Simplify refcounting with rcuref_t" from Sebastian Siewior cleans up and optimizing the refcounting in the ucount code. - The series "reboot: support runtime configuration of emergency hw_protection action" from Ahmad Fatoum improves the ability for a driver to perform an emergency system shutdown or reboot. - The series "Converge on using secs_to_jiffies() part two" from Easwar Hariharan performs further migrations from msecs_to_jiffies() to secs_to_jiffies(). - The series "lib/interval_tree: add some test cases and cleanup" from Wei Yang permits more userspace testing of kernel library code, adds some more tests and performs some cleanups. - The series "hung_task: Dump the blocking task stacktrace" from Masami Hiramatsu arranges for the hung_task detector to dump the stack of the blocking task and not just that of the blocked task. - The series "resource: Split and use DEFINE_RES*() macros" from Andy Shevchenko provides some cleanups to the resource definition macros. - Plus the usual shower of singleton patches - please see the individual changelogs for details. * tag 'mm-nonmm-stable-2025-03-30-18-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (77 commits) mailmap: consolidate email addresses of Alexander Sverdlin fs/procfs: fix the comment above proc_pid_wchan() relay: use kasprintf() instead of fixed buffer formatting resource: replace open coded variant of DEFINE_RES() resource: replace open coded variants of DEFINE_RES_*_NAMED() resource: replace open coded variant of DEFINE_RES_NAMED_DESC() resource: split DEFINE_RES_NAMED_DESC() out of DEFINE_RES_NAMED() samples: add hung_task detector mutex blocking sample hung_task: show the blocker task if the task is hung on mutex kexec_core: accept unaccepted kexec segments' destination addresses watchdog/perf: optimize bytes copied and remove manual NUL-termination lib/interval_tree: fix the comment of interval_tree_span_iter_next_gap() lib/interval_tree: skip the check before go to the right subtree lib/interval_tree: add test case for span iteration lib/interval_tree: add test case for interval_tree_iter_xxx() helpers lib/rbtree: add random seed lib/rbtree: split tests lib/rbtree: enable userland test suite for rbtree related data structure checkpatch: describe --min-conf-desc-length scripts/gdb/symbols: determine KASLR offset on s390 ...