summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
15 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
15 hoursMerge branch 'for-mfd-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
40 hoursMerge remote-tracking branch 'regulator/for-7.3' into regulator-nextMark Brown
2 daysregulator: core: regulator_lock_two() should test for EDEADLK not EDEADLOCKTimur Tabi
Compare against -EDEADLK, which is what ww_mutex_lock() actually returns and what every other deadlock check in this file already uses. Function regulator_lock_two() acquires two regulators via regulator_lock_nested() -> ww_mutex_lock(). On contention, ww_mutex_lock() returns -EDEADLK, which is the caller's signal to drop the lock it holds and retry the acquisition in the canonical order. However, regulator_lock_two() tests the return value against -EDEADLOCK rather than -EDEADLK. On most architectures, EDEADLK and EDEADLOCK are the same value, so the comparison happens to be correct and the bug is invisible. But on MIPS, SPARC, and PowerPC, those two errors have different values. The test is wrong: a genuine -EDEADLK backoff no longer matches -EDEADLOCK, so instead of unlocking and retrying, the code falls into WARN_ON(ret) and returns with only one of the two regulators locked. In practice, this is a bug only on MIPS, because the regulator core is not built or used on the other two platforms. In general, EDEADLK is preferred over EDEADLOCK for new code. Fixes: cba6cfdc7c3f ("regulator: core: Avoid lockdep reports when resolving supplies") Signed-off-by: Timur Tabi <ttabi@nvidia.com> Link: https://patch.msgid.link/20260708235722.2953579-1-ttabi@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
2 daysregulator: mt6363: add missing MODULE_DEVICE_TABLE()Pengpeng Hou
The driver has an OF match table wired to .of_match_table, but does not export the table with MODULE_DEVICE_TABLE(). Add the missing MODULE_DEVICE_TABLE(of, ...) entry so module alias information is generated for OF based module autoloading. This is a source-level fix. It does not claim dynamic hardware reproduction; the evidence is the driver-owned match table, its use by the platform driver, and the missing module alias publication. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260704124352.7981-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2 daysregulator: mt6316: add missing MODULE_DEVICE_TABLE()Pengpeng Hou
The driver has an OF match table wired to .of_match_table, but does not export the table with MODULE_DEVICE_TABLE(). Add the missing MODULE_DEVICE_TABLE(of, ...) entry so module alias information is generated for OF based module autoloading. This is a source-level fix. It does not claim dynamic hardware reproduction; the evidence is the driver-owned match table, its use by the platform driver, and the missing module alias publication. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260704122926.21586-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
4 daysregulator: qcom_usb_vbus: add pm4125 VBUS regulator supportMark Brown
Rakesh Kota <rakesh.kota@oss.qualcomm.com> says: Add support for PM4125 USB VBUS regulator. Unlike PM8150B which uses a current-limit selector, PM4125 uses a 2-bit VBOOST voltage selector supporting 4.25 V, 4.5 V, 4.75 V and 5.0 V output. Link: https://patch.msgid.link/20260706-add_pm4125-vbus-reg-v3-0-999d78a87b81@oss.qualcomm.com
4 daysregulator: qcom_usb_vbus: add support for qcom,pm4125-vbus-regRakesh Kota
The PM4125 PMIC uses a different register layout for USB VBUS control compared to PM8150B. On PM4125, CMD_OTG is at offset 0x50, OTG_CFG is at 0x56, and offset 0x52 is a 2-bit VBOOST voltage selector rather than a current-limit selector. Add pm4125_data using the abstraction introduced for PM8150B, along with dedicated voltage-selector ops and the pm4125_vboost_table covering the four supported boost voltages: 4.25 V, 4.5 V, 4.75 V, and 5.0 V. Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260706-add_pm4125-vbus-reg-v3-3-999d78a87b81@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
4 daysregulator: qcom_usb_vbus: add register abstraction and PM8150B supportRakesh Kota
Introduce per-compatible regulator descriptor data via struct qcom_usb_vbus_reg_data to abstract register layout differences between PMICs. This allows the probe function to dynamically populate the regulator_desc fields rather than relying on compile-time constants. Refactor the existing PM8150B support to use this abstraction, wiring in its CMD_OTG, OTG_CFG, and current-limit registers through pm8150b_data. No functional change is intended for PM8150B. Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/20260706-add_pm4125-vbus-reg-v3-2-999d78a87b81@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysregulator: Add regulator driver for Unisoc SC2730 PMICOtto Pflüger
Add a regulator driver for the Spreadtrum/Unisoc SC2730 PMIC, used e.g. with the UMS512 and UMS9230 SoCs. This version of the driver is based on a downstream driver provided by Unisoc [1][2] and the existing SC2731 driver. [1]: https://github.com/MotorolaMobilityLLC/kernel-sprd/commit/30be0ddfe6b9a877fc9c328fbd2bae84e645eb31 [2]: https://github.com/MotorolaMobilityLLC/kernel-sprd/blob/android-13-release-tla33/drivers/regulator/sc2730-regulator.c Signed-off-by: Zhongfa Wang <zhongfa.wang@unisoc.com> [cleanup, adapt to new device tree requirements] Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de> Link: https://patch.msgid.link/20260701-sc2730-regulators-v7-2-6e145ce83657@abscue.de Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysReplace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c ↵Uwe Kleine-König (The Capable Hub)
files) Replace the #include of <linux/mod_devicetable.h> by the more specific <linux/device-id/*.h> where applicable. For most cases the include can be dropped completely, only a few drivers need one or two headers added. Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
8 daysregulator: max8998_pmic_dt_parse_pdata: of_node_put on reg_np after ↵WenTao Liang
ownership transferred to rdata In max8998_pmic_dt_parse_pdata(), of_get_child_by_name() acquires a reference on reg_np which is then stored in rdata->reg_node, transferring ownership to the regulator data array. The subsequent of_node_put(reg_np) at the end of the function releases the last matched regulator node's reference, leaving rdata->reg_node as a dangling pointer for the last entry. Remove the spurious of_node_put(reg_np) call. Cc: stable@vger.kernel.org Fixes: 156f252857df ("drivers: regulator: add Maxim 8998 driver") Signed-off-by: WenTao Liang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20260626160326.54457-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysregulator: as3722_get_regulator_dt_data: fix premature of_node_put leaving ↵WenTao Liang
dangling of_node pointer In as3722_get_regulator_dt_data(), of_get_child_by_name() acquires a reference on np, which is then assigned to pdev->dev.of_node. The function immediately calls of_node_put(np), releasing the reference and leaving pdev->dev.of_node as a dangling pointer. Remove the of_node_put(np) call to let the device hold the reference. Cc: stable@vger.kernel.org Fixes: bc407334e9a6 ("regulator: as3722: add regulator driver for AMS AS3722") Signed-off-by: WenTao Liang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20260626160150.54291-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysmfd: db8500-prcmu: Fold dbx500 header into db8500Linus Walleij
Move the DBx500 PRCMU definitions into the DB8500 PRCMU header and delete the wrapper header. Convert users of simple PRCMU wrappers to call the DB8500 helpers directly. The dbx500-prcmu.h header was the result of an earlier attempt to abstract several DBx5x SoC PRCMU units to use the same abstract header. They are deleted from the kernel and this is not just causing maintenance burden and build errors. The stub code is using -ENOSYS in a way checkpatch complains about so replace these with -EINVAL while we're at it. Assisted-by: Codex:gpt-5-5 Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202606180825.vUSQntkJ-lkp@intel.com/ Signed-off-by: Linus Walleij <linusw@kernel.org> Acked-by: Brian Masney <bmasney@redhat.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/oe-kbuild-all/202606180825.vUSQntkJ-lkp@intel.com/ Link: https://patch.msgid.link/20260619-mfd-prcmu-merge-headers-v1-1-8ea0ee23b4d6@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
10 daysregulator: tps6594: Fix device node reference leaks in multiphase loopUday Khare
In tps6594_regulator_probe(), the multi-phase configuration loop calls of_find_node_by_name() to find buck nodes by name, and of_get_parent() twice to navigate to the PMIC parent node. None of the acquired node references (np, intermediate parent, np_pmic_parent) are ever released via of_node_put(), causing a reference leak on every loop iteration. Additionally, of_find_node_by_name() can return NULL, but the result was immediately passed to of_node_full_name() and of_get_parent() without a NULL check, which could lead to a NULL pointer dereference. Fix this by: - Adding a NULL check for np after of_find_node_by_name() - Storing the intermediate parent node in a local variable np_parent - Calling of_node_put() on np, np_parent and np_pmic_parent at the end of each loop iteration Fixes: f17ccc5deb4d ("regulator: tps6594-regulator: Add driver for TI TPS6594 regulators") Signed-off-by: Uday Khare <udaykhare77@gmail.com> Link: https://patch.msgid.link/20260618132327.11529-1-udaykhare77@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
10 daysregulator: Rework i2c_device_id initialisationMark Brown
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> says: [Nothing] Link: https://patch.msgid.link/cover.1782827697.git.u.kleine-koenig@baylibre.com
10 daysregulator: Improve style of i2c_device_id arraysUwe Kleine-König (The Capable Hub)
The two previous patches did some style improvements while adapting the i2c_device_id arrays. Adapt all the remaining regulator drivers to use the same style. That is: - Use a comma after a initialisation value unless the closing } is in the same line. - Don't use a comma after the list terminator. - Use a space after the opening { and one before the closing }; a single space for an empty pair. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/221a2e634f6bbf9638b906470ffb1b2b413e0a5a.1782827697.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
10 daysregulator: Use named initializers for arrays of i2c_device_dataUwe Kleine-König (The Capable Hub)
While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition. The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union. While touching all these arrays, unify usage of whitespace and commas. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/2e83a9747ac2c92db8f91fd0e0eb311c4efe8e73.1782827697.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
10 daysregulator: Drop unused i2c driver dataUwe Kleine-König (The Capable Hub)
The two drivers explicitly set .driver_data to zero but don't use this value. So drop the explicit assignment. While touching these arrays, unify usage of whitespace and commas, and use named initializers. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/ce4f4851f16d8eea9cca632017d8c64c39ab2bcb.1782827697.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
11 daysregulator: rtq2208: Remove the unnecessary MTP_SEL propertyMark Brown
ChiYuan Huang <cy_huang@richtek.com> says: This patch series remove the 'richtek,mtp-sel-high' property usage. Link: https://patch.msgid.link/cover.1782444299.git.cy_huang@richtek.com
11 daysregualtor: rtq2208: Initiate the default MTP_SEL state by hardware registerChiYuan Huang
Read the initial MTP_SEL state by hardware register to prevent the wrong specified property value from the conflict of hardware pin assignment. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://patch.msgid.link/557e872a87c603a26cf91f0d4448e527afcbbae8.1782444299.git.cy_huang@richtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
11 daysAdd support for the REFGEN in the IPQ9650 SoCMark Brown
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> says: IPQ9650 SoC has 2 REFGEN blocks providing the reference current to the PCIe and USB, UNIPHY PHYs. For the other SoCs, clocks for this block is enabled on power up but that's not the case for IPQ9650 and we have to explicitly enable those clocks. Document the same and add support for it. Correct the regulator type to REGULATOR_CURRENT, as the REFGEN block supplies the reference current to PHYs in the SoC, per the REFGEN IP team, aligning it with the hardware behavior. Link: https://patch.msgid.link/20260617-ipq9650_refgen-v4-0-c505ea6c6661@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
11 daysregulator: qcom-refgen: add support for the IPQ9650 SoCKathiravan Thirumoorthy
IPQ9650 SoC has 2 REFGEN blocks providing the reference current to the PCIe and USB, UNIPHY PHYs. For the other SoCs, clock for this block is enabled on power up but that's not the case for IPQ9650 and we have to enable those clocks explicitly to bring up the PHYs properly. Also, add the get_status() callback to report the regulator status to the userspace. Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260617-ipq9650_refgen-v4-3-c505ea6c6661@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
11 daysregulator: qcom-refgen: correct the regulator type to CURRENTKathiravan Thirumoorthy
As per the REFGEN IP team, this block supplies the reference current to the PHYs in the SoC. So, correct the regulator type to REGULATOR_CURRENT to match with the HW behavior. Fixes: 7cbfbe237960 ("regulator: Introduce Qualcomm REFGEN regulator driver") Cc: stable@vger.kernel.org Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> Link: https://patch.msgid.link/20260617-ipq9650_refgen-v4-1-c505ea6c6661@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
11 daysregulator: max14577: fix set_mode clobbering enable on MAX77836 LDOsJad Keskes
So the PWRMD field in CNFG1_LDO is both the enable bit and the mode. You can't change one without stepping on the other. The problem is that enable() from the regulator core just writes enable_mask (which is PWRMD_NORMAL). If you'd called set_mode(LPM) then disabled and re-enabled, the mode gets reset to NORMAL. And set_mode updates the register through the same field, so it can accidentally enable a disabled regulator. Fix it by storing the mode in per-regulator data. A custom enable writes whatever mode was last set. set_mode only touches hardware if the regulator is already on; otherwise it just caches the value. Add of_map_mode while here so the initial mode can be wired from DT. Signed-off-by: Jad Keskes <inasj268@gmail.com> Acked-by: Lee Jones <lee@kernel.org> Link: https://patch.msgid.link/20260617094622.1846471-1-inasj268@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-26Merge tag 'regulator-fix-v7.2-merge-window' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A couple of unremarkable driver specific fixes that came in during the merge window" * tag 'regulator-fix-v7.2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: da9121: Use subvariant ids in the I2C table regulator: pca9450: Correct default t_off_deb for PCA9451A/PCA9452
2026-06-24regulator: da9121: Use subvariant ids in the I2C tablePengpeng Hou
da9121_i2c_probe() stores i2c_get_match_data() in chip->subvariant_id and da9121_assign_chip_model() switches on DA9121_SUBTYPE_* values. The OF table provides those subvariant values, but the I2C id table currently provides DA9121_TYPE_* values. Make the I2C id table use the same subvariant namespace as the OF table so non-DT I2C matches feed the expected data type into the model assignment code. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260624060024.61300-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-19regulator: pca9450: Correct default t_off_deb for PCA9451A/PCA9452Joy Zou
The PMIC PCA9451A and PCA9452 have a default power-off debounce time of 2ms according to their datasheet, while PCA9450A and PCA9450BC use 120us. Add default_t_off_deb field to struct pca9450 to support per-variant default configuration when the device tree property is not specified. Datasheet reference links: - PCA9451A Rev.2.1: https://www.nxp.com/docs/en/data-sheet/PCA9451A.pdf - PCA9452 Rev.1.0: https://www.nxp.com/docs/en/data-sheet/PCA9452.pdf Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260618-b4-regulator-opt-v1-1-c43b1f62aaf6@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-16Merge tag 'regulator-v7.2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "The development of the regulator subsystem continues to be quite quiet, we've got several new devices, removal of one old device and some kernel wide cleanup of platform devices but nothing in the core. - Cleanups of platform_device_id usage - Filling out and fixing of the description of the MediaTek MT6359 - Removal of the PCAP regulator driver, the MFD has been removed - New device support for Qualcomm Nord RPMH, PM8109, PM8150 and PMAU0102, and SG Micro SGM3804" * tag 'regulator-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (23 commits) regulator: dt-bindings: mt6311: Convert to DT schema regulator: qcom_smd-regulator: Add PM8019 regulator: dt-bindings: qcom,smd-rpm-regulator: Add PM8019 regulator: mt6359: Fix vbbck default internal supply name regulator: bq257xx: drop confusing configuration of_node regulator: Unify usage of space and comma in platform_device_id arrays regulator: Use named initializers for platform_device_id arrays regulator: Drop unused assignment of platform_device_id driver data regulator: scmi: fix of_node refcount leak in scmi_regulator_probe() regulator: remove used pcap regulator driver regulator: add SGM3804 Dual Output driver regulator: dt-bindings: document the SGM3804 Dual Output regulator regulator: mt6359: Add proper ldo_vcn33_[12] regulators regulator: mt6359: Add regulator supply names regulator: mt6359: const-ify regulator descriptions regulator: dt-bindings: mt6359: Deprecate bogus vcn33_[12]_* split regulators regulator: dt-bindings: mt6359: Drop regulator-name pattern restrictions regulator: palmas: Move MODULE_DEVICE_TABLE next to the table itself regulator: qcom_smd: Add PM8150 regulators regulator: dt-bindings: qcom,smd-rpm-regulator: Document PM8150 IC ...
2026-06-09regulator: qcom_smd-regulator: Add PM8019Mark Brown
Stephan Gerhold <stephan.gerhold@linaro.org> says: Add the definitions and dt-bindings for the regulators in PM8019 to allow controlling them through the RPM firmware. PM8019 is typically used together with the MDM9607 SoC. Link: https://patch.msgid.link/20260608-rpm-smd-regulator-pm8019-v1-0-c671388b9ea5@linaro.org
2026-06-09regulator: qcom_smd-regulator: Add PM8019Stephan Gerhold
Add the definitions for the regulators in PM8019 to allow controlling them through the RPM firmware. Reading the TYPE/SUBTYPE registers using SPMI reveals that PM8019 uses a mixture of regulators from PMA8084 (hfsmps, pldo) and PM8916 (nldo). Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260608-rpm-smd-regulator-pm8019-v1-2-c671388b9ea5@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-09regulator: mt6359: Fix vbbck default internal supply nameChen-Yu Tsai
This issue was pointed out by Sashiko. vbbck is fed internally from vio18. For the MT6359, the default supply name was incorrectly set as "VIO18", instead of the supply's default "VIO18". In practice this still works, but it causes the regulator description copy and replace to always happen. For the MT6359P the name is correct. Fix the supply name for MT6359 so that both instances are the same and correct. Also copy the comment about the internal supply from the MT6359 list to the MT6359P list. Fixes: 10be8fc1d534 ("regulator: mt6359: Add regulator supply names") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20260609083630.1600070-1-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-04regulator: bq257xx: drop confusing configuration of_nodeJohan Hovold
The driver reuses the OF node of the parent multi-function device but still sets the of_node field of the regulator configuration to any prior OF node. Since the MFD child device does not have an OF node set until probe is called, this field is set to NULL on first probe and to the reused OF node if the driver is later rebound. As the device_set_of_node_from_dev() helper drops a reference to any prior OF node before taking a reference to the new one this can apparently also confuse LLMs like Sashiko which flags it as a potential use-after-free (which it is not). Drop the confusing and redundant configuration of_node assignment. Link: https://sashiko.dev/#/patchset/20260408073055.5183-1-johan%40kernel.org Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260604115912.2734074-1-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-02regulator: Use named initializers for platform_device_id arraysMark Brown
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> says: this series targets to use named initializers for platform_device_id arrays. In general these are better readable for humans and more robust to changes in the respective struct definition. This robustness is needed as I want to do Link: https://patch.msgid.link/cover.1779878004.git.u.kleine-koenig@baylibre.com
2026-06-02regulator: Unify usage of space and comma in platform_device_id arraysUwe Kleine-König (The Capable Hub)
After converting all these arrays to use named initializers and fixing coding style en passant, adapt the coding style also for those drivers that already used named initializers before for consistency. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/a3a2736ebfcfa5a228dcebfbfefc14960dcce314.1779878004.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-02regulator: Use named initializers for platform_device_id arraysUwe Kleine-König (The Capable Hub)
Named initializers are better readable and more robust to changes of the struct definition. This robustness is relevant for a planned change to struct platform_device_id replacing .driver_data by an anonymous unit. While touching these arrays unify spacing and usage of commas. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Acked-by: Karel Balej <balejk@matfyz.cz> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/d02f55dfd5bdd743ae5cd76f2a5af0d346226a68.1779878004.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-02regulator: Drop unused assignment of platform_device_id driver dataUwe Kleine-König (The Capable Hub)
Several drivers explicitly set the .driver_data member of struct platform_device_id to zero without relying on that value. Drop these unused assignments. While touching these arrays unify spacing, usage of commas and use named initializers for .name. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/613cd1bed263c2bf562ee714595f6d57f442804d.1779878004.git.u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-02regulator: scmi: fix of_node refcount leak in scmi_regulator_probe()Wentao Liang
scmi_regulator_probe() calls of_find_node_by_name() which takes a reference on the returned device node. On the error path where process_scmi_regulator_of_node() fails, the function returns without calling of_node_put() on the child node, leaking the reference. Add of_node_put(np) on the error path to properly release the reference. Cc: stable@vger.kernel.org Fixes: 0fbeae70ee7c ("regulator: add SCMI driver") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20260527104850.872415-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-28regulator: remove used pcap regulator driverArnd Bergmann
The platform was removed a few years ago, and the mfd driver is also gone now, so it is impossible to build or use it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260527193837.3436148-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-26regulator: mt6363: select CONFIG_IRQ_DOMAINArnd Bergmann
When build-testing this driver without CONFIG_IRQ_DOMAIN causes a compile-time error: drivers/regulator/mt6363-regulator.c: In function 'mt6363_regulator_probe': drivers/regulator/mt6363-regulator.c:884:18: error: implicit declaration of function 'irq_find_host' [-Wimplicit-function-declaration] 884 | domain = irq_find_host(interrupt_parent); | ^~~~~~~~~~~~~ drivers/regulator/mt6363-regulator.c:884:16: error: assignment to 'struct irq_domain *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 884 | domain = irq_find_host(interrupt_parent); | ^ drivers/regulator/mt6363-regulator.c:896:30: error: implicit declaration of function 'irq_create_fwspec_mapping'; did you mean 'irq_create_of_mapping'? [-Wimplicit-function-declaration] 896 | info->virq = irq_create_fwspec_mapping(&fwspec); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | irq_create_of_mapping This is rather hard to trigger because so many other drivers enable IRQ_DOMAIN already, but I ran into this on an s390 randconfig build. Ensure this is always enabled using a Kconfig 'select IRQ_DOMAIN' entry, as we do for all other users of this. Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20260526102003.2527570-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-24regulator: add support for SGM3804 Dual Output driverMark Brown
Neil Armstrong <neil.armstrong@linaro.org> says: Add support for the SG Micro SGM3804 Single Inductor Dual Output Buck/Boost Converter used to power LCD panels a provide positive and negative power rails with configurable voltage and active discharge function for each output. The SGM3804 is powered by the enable GPIO pins inputs and only supports I2C write messages. In order to add flexibility and simplify the driver, the regmap cache is enabled and populated with default values since we can't write registers when the 2 GPIOs are down. This regulator is used to provide vsn and vsn power to the Ayaneo Pocket S2 dual-DSI LCD panel. Link: https://patch.msgid.link/20260522-topic-sm8650-ayaneo-pocket-s2-sgm3804-v5-0-bd6b1c300ecc@linaro.org
2026-05-24regulator: add SGM3804 Dual Output driverKancyJoe
Add support for the SG Micro SGM3804 Single Inductor Dual Output Buck/Boost Converter used to power LCD panels a provide positive and negative power rails with configurable voltage and active discharge function for each output. The SGM3804 is powered by the enable GPIO pins inputs and only supports I2C write messages. In order to add flexibility and simplify the driver, the regmap cache is enabled and populated with default values since we can't write registers when the 2 GPIOs are down. Signed-off-by: KancyJoe <kancy2333@outlook.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260522-topic-sm8650-ayaneo-pocket-s2-sgm3804-v5-2-bd6b1c300ecc@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-20regulator: mt6359: Add proper ldo_vcn33_[12] regulatorsChen-Yu Tsai
The ldo_vcn33_[12]_wifi and ldo_vcn33_[12]_bt are just two regulator outputs instead of four. The wifi and bt parts refer to separate enable bits that are OR-ed together to affect the actual regulator output. The separate bits allow the wifi and bt stacks to enable their power without coordination between them. These have been deprecated in favor of proper nodes matching the output. Add proper ldo_vcn33_[12] regulators to replace the existing ones. The enable status is synced to just one of the two enable bits, and the other is forced off. This makes the handling in other bits simpler. The existing *_(bt|wifi) regulators are converted to no-op regulators that are fed from their new respective ldo_vcn33_[12] regulator. This allows existing device trees to continue to work. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20260514091520.2718987-7-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-20regulator: mt6359: Add regulator supply namesChen-Yu Tsai
The MT6359 regulator DT binding defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. The buck regulators each have their own supply. The name of the supply is related to the name of the buck regulator. The LDOs have shared supplies. Add the supply name to the declaration of each regulator. At the moment they are declared explicitly, but the buck regulator macro can be made to derive both the match string and supply name from the base name once the *_sshub regulators are figured out and removed. For context, the *_sshub regulators are not separate regulators, but separate settings for the same name regulators without the "_sshub" suffix. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20260514091520.2718987-6-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-20regulator: mt6359: const-ify regulator descriptionsChen-Yu Tsai
The regulator descriptions and extended descriptions don't change at runtime. The only reason they are not const is that the regulator driver data is non-const. Const-ify the descriptions and all references to them. For the driver data, explicitly cast it to non-const void *. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20260514091520.2718987-5-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18regulator: tps65219: fix irq_data.rdev not being assignedAlexander Sverdlin
Commit 64a6b577490c ("regulator: tps65219: Remove debugging helper function") removed the tps65219_get_rdev_by_name() helper along with the irq_data.rdev assignment that depended on it. This left irq_data.rdev uninitialized for all IRQs, causing undefined behavior when regulator_notifier_call_chain() is called from the IRQ handler: Internal error: Oops: 0000000096000004 pc : regulator_notifier_call_chain lr : tps65219_regulator_irq_handler Call trace: regulator_notifier_call_chain tps65219_regulator_irq_handler handle_nested_irq regmap_irq_thread irq_thread_fn irq_thread kthread ret_from_fork Instead of restoring a dedicated lookup array, restructure the probe function to combine regulator registration with IRQ registration in the same loop. This way the rdev returned by devm_regulator_register() is naturally available for assigning to irq_data.rdev without any auxiliary data structure. Non-regulator IRQs (SENSOR, TIMEOUT) that don't correspond to any registered regulator are registered with rdev=NULL, and the IRQ handler is protected with a NULL check to avoid crashing. Cc: stable@vger.kernel.org Closes: https://lore.kernel.org/all/aBDSTxALaOc-PD7X@gaggiata.pivistrello.it/ Reported-by: Francesco Dolcini <francesco@dolcini.it> Fixes: 64a6b577490c ("regulator: tps65219: Remove debugging helper function") Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com> Link: https://patch.msgid.link/20260518083113.2063368-1-alexander.sverdlin@siemens.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-11regulator: Kconfig: fix a typo in helpIhor Matushchak
Fixes a typo in Kconfig, 'protectorvia' -> 'protector via'. Signed-off-by: Ihor Matushchak <ihor.matushchak@foobox.net> Link: https://patch.msgid.link/20260508084933.4076-1-ihor.matushchak@foobox.net Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-06regulator: qcom-rpmh: Fix index for pmh0101 ldo16Fenglin Wu
The wrong index is assigned to pmh0101 ldo16, which results incorrect rpmh resource being used when the regulator device is voted. Fix it. Fixes: 65efe5404d15 ("regulator: rpmh-regulator: Add RPMH regulator support for Glymur") Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260506-fix_pmh0101_ldo16_index-v1-1-cdc8708b01f4@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-05regulator: palmas: Move MODULE_DEVICE_TABLE next to the table itselfKrzysztof Kozlowski
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it exports, because this is easier to read and verify. It also makes more sense since #ifdef for ACPI or OF could hide both of them. Most of the privers already have this correctly placed, so adjust the missing ones. No functional impact. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260505102734.180464-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-05regulator: Add PM8150 PMIC supportMark Brown
Rakesh Kota <rakesh.kota@oss.qualcomm.com> says: PM8150 is a power management IC. It is used in shikra boards. Link: https://patch.msgid.link/20260429-add_pm8150_regulators-v1-0-9879c0967cf0@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>