Commit Graph

5223 Commits

Author SHA1 Message Date
Linus Torvalds
c5bf33d778 regulator: Fix for v6.17
This fixes an issue with the newly added code for handling large voltage
 changes on regulators which require that individual voltage changes
 cover a limited range, the check for convergence was broken.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmiV71cACgkQJNaLcl1U
 h9BT/wf/RFUziTbJP13+I+Ce+BixwFOfTJ2+aE2xlCWAd8eyylxdOvZwRaxiiU8K
 2o8mfyVpGitROyEgsuXDqiel1hFTSVpuFzT8NhGe9tc5RC+UtF1nuygsMvPAuUlR
 cyrGF4aUSsEGr5R37lZh6dC/kJDHOxoQy+YEk9ngnnfWlddpHJsQMulWU3MIVAaG
 IZ3KVQeZeEpCNkgKr50IG/TQh9bX8Dct/EPSxKhR4EjaKXvEyKcrMnbQpb7h7dxN
 dUFpKk99EKpC6uI7jLIwUgIA4CCN8h2g0+B10zo4Kp2AQLltGs/H/gZJSCzKzEv8
 3UTeyBz8Uzr4srsKRBiP8woqA6hjoA==
 =xTjP
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v6.17-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "This fixes an issue with the newly added code for handling large
  voltage changes on regulators which require that individual voltage
  changes cover a limited range, the check for convergence was broken"

* tag 'regulator-fix-v6.17-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: correct convergence check in regulator_set_voltage()
2025-08-09 08:41:53 +03:00
Bartosz Golaszewski
d9d87d90cc treewide: rename GPIO set callbacks back to their original names
The conversion of all GPIO drivers to using the .set_rv() and
.set_multiple_rv() callbacks from struct gpio_chip (which - unlike their
predecessors - return an integer and allow the controller drivers to
indicate failures to users) is now complete and the legacy ones have
been removed. Rename the new callbacks back to their original names in
one sweeping change.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-08-07 10:07:06 +02:00
Linus Torvalds
07b4382043 power supply and reset changes for the 6.17 series
* power-supply core
   - battery-info: replace any DT specific bits with fwnode usage
   - replace any device-tree code with generic fwnode based handling
  * power-supply drivers
   - ug3105_battery: use battery-info API
   - qcom_battmgr: report capacity
   - qcom_battmgr: support LiPo battery reporting
   - add missing missing power-supply ref to a bunch of DT bindings
   - update drivers regarding pm_runtime_autosuspend() usage
   - misc. minor fixes and cleanups
  * reset drivers
   - misc. minor cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmiMECsACgkQ2O7X88g7
 +pq18BAAgwWUJyV1YrzODAEC+GAIScV7E9aWHiWBYaR6huI6sXssgM9sUyQvSDw8
 IawbPGVeqgK2g7JHdLqduMILGrmNh268b2l3aJJzN0erM2bcIs9RtB2bMzJgSChH
 eDPOLKlQJJqR/PMQowHE4UEmbIep+8ISLP9GuiIa0e46ckdPWtAKnxWdReC3Pefs
 h9eRnzZof6A3dfoIhpCe182+RXPbVll7eHk8kvSYZgVUHHMfN509JDC7VMv6dG5p
 XOUiS6h2mebqoaNKBF7swr0nmkv4zLpLWBc//rreP+v26C97Ks+tfNrZ/fKrRR7E
 L7M1peg7KPLFooM3dQrngbaO2/h4am2kPb92YreXuDHMEBJQuauhOgAmrPOCFmJi
 l/nN2IbY4J9ArdsVbwATriFMPyem/N60xiq6Tr0F7DS9GBcO5dqX8g9iHY68Qu/g
 9HZAhiqrmxpUQ5cDUG1eYWSoK6YvdoP5bM7wJz8W5kbnIx2ngsMBhWPPh2fTmtoE
 c3qU7gSZK3jKUYAzu4vbFyL/htKc6ZO8ej2VDwjBb2OjVx+leYeC7kasRPDy5MkO
 G8Zuq9DZ1QAPp9aYAFVmZbHH1bTMD0UeYNMnSW/KaJZ5WecbUlzUkgCJvnH3JcYm
 5JbKDFykvItcyiS7+c6fflrJuv510Hf3R3degaqqXby4v80bMnY=
 =Lfxr
 -----END PGP SIGNATURE-----

Merge tag 'for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:
   - battery-info: replace any DT specific bits with fwnode usage
   - replace any device-tree code with generic fwnode based handling

  Power-supply drivers:
   - ug3105_battery: use battery-info API
   - qcom_battmgr: report capacity
   - qcom_battmgr: support LiPo battery reporting
   - add missing missing power-supply ref to a bunch of DT bindings
   - update drivers regarding pm_runtime_autosuspend() usage
   - misc minor fixes and cleanups

  Reset drivers:
   - misc minor cleanups"

* tag 'for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits)
  power: supply: core: fix static checker warning
  power: supply: twl4030_charger: Remove redundant pm_runtime_mark_last_busy() calls
  power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls
  MAINTAINERS: rectify file entry in QUALCOMM SMB CHARGER DRIVER
  power: supply: max1720x correct capacity computation
  MAINTAINERS: add myself as smbx charger driver maintainer
  power: supply: pmi8998_charger: rename to qcom_smbx
  power: supply: qcom_pmi8998_charger: fix wakeirq
  power: supply: max14577: Handle NULL pdata when CONFIG_OF is not set
  power: return the correct error code
  power: reset: POWER_RESET_TORADEX_EC should depend on ARCH_MXC
  power: supply: cpcap-charger: Fix null check for power_supply_get_by_name
  power: supply: bq25980_charger: Constify reg_default array
  power: supply: bq256xx_charger: Constify reg_default array
  power: reset: at91-sama5d2_shdwc: Refactor wake-up source logging to use dev_info
  power: reset: qcom-pon: Rename variables to use generic naming
  power: supply: qcom_battmgr: Add lithium-polymer entry
  power: supply: qcom_battmgr: Report battery capacity
  power: supply: bq24190: Free battery_info
  power: supply: ug3105_battery: Switch to power_supply_batinfo_ocv2cap()
  ...
2025-07-31 21:39:01 -07:00
Romain Gantois
10dfd36f07 regulator: core: correct convergence check in regulator_set_voltage()
The logic in regulator_set_voltage() which checks for a non-convergence
condition on a stepped regulator is flawed.

regulator_set_voltage() checks if the error in target voltage has increased
or decreased, and returns -EWOULDBLOCK if the error has not decreased
enough. The correct non-convergence condition is:

new_delta - delta > -rdev->constraints->max_uV_step

or equivalently:

delta - new_delta < rdev->constraints->max_uV_step

But the currently used condition is:

new_delta - delta > rdev->constraints->max_uV_step

Which may cause an infinite loop if the voltage error doesn't converge.

Fix this by correcting the convergence condition.

Suggested-by: Jon Hunter <jonathanh@nvidia.com>
Fixes: d511206dc7 ("regulator: core: repeat voltage setting request for stepped regulators")
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Link: https://patch.msgid.link/20250729-b4-regulator-stepping-fix-v1-1-3f7b8c55d7d7@bootlin.com
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-29 14:56:39 +01:00
Colin Ian King
0bd042ae77
regulator: mt6370: Fix spelling mistake in mt6370_regualtor_register
The function name mt6370_regualtor_register contains a spelling mistake,
fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250724114832.146718-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 18:04:38 +01:00
Colin Ian King
71d141edbf
regulator: Kconfig: Fix spelling mistake "regualtor" -> "regulator"
There is a spelling mistake in the REGULATOR_RT4803 config. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250724113113.143009-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-24 12:39:05 +01:00
Romain Gantois
d511206dc7
regulator: core: repeat voltage setting request for stepped regulators
The regulator_set_voltage() function may exhibit unexpected behavior if the
target regulator has a maximum voltage step constraint. With such a
constraint, the regulator core may clamp the requested voltage to a lesser
value, to ensure that the voltage delta stays under the specified limit.

This means that the resulting regulator voltage depends on the current
voltage, as well as the requested range, which invalidates the assumption
that a repeated request for a specific voltage range will amount to a noop.

Considering the case of a regulator with a maximum voltage step constraint
of 1V:

initial voltage: 2.5V

consumer requests 4V
expected result: 3.5V
resulting voltage: 3.5V

consumer requests 4V again
expected result: 4V
actual result: 3.5V

Correct this by repeating attempts to balance the regulator voltage until
the result converges.

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Link: https://patch.msgid.link/20250718-regulator-stepping-v2-1-e28c9ac5d54a@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-18 16:17:09 +01:00
Jeff Chang
63be976da9
regulator: rt6160: Add rt6166 vout min_uV setting for compatible
1. remove unintentional GPL change
2. using switch case for Device ID probe check.

Signed-off-by: Jeff Chang <jeff_chang@richtek.com>
Link: https://patch.msgid.link/20250716021230.2660564-1-jeff_chang@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-16 11:15:26 +01:00
Jisheng Zhang
43728a6434
regulator: tps6286x-regulator: Fix a copy & paste error
The volatile_reg function is named as tps6287x_volatile_reg by mistake
when enabing the REGCACHE_MAPLE support.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20250714010456.4906-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-14 14:44:05 +01:00
Mark Brown
b88b7e2096
Add RPMh regulator support for PM7550 & PMR735B
Merge series from Luca Weiss <luca.weiss@fairphone.com>:

Document and add support for the regulators on PM7550 and PMR735B, which
can be paired with the Milos SoC.
2025-07-14 11:34:22 +01:00
Luca Weiss
3aa47d2ec8
regulator: qcom-rpmh: add support for pm7550 regulators
Add RPMH regulators exposed by Qualcomm Technologies, Inc. PM7550 PMIC.
It has 6 FTS525 (FT-SMPS) and 23 LDOs with 3 different types.
L1-L11 are LDO515 LV NMOS, L12-L13 are LDO515 MV PMOS, L14-L23 are
LDO512 MV PMOS.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://patch.msgid.link/20250711-pm7550-pmr735b-rpmh-regs-v2-4-bca8cc15c199@fairphone.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:37:09 +01:00
Luca Weiss
2875843490
regulator: qcom-rpmh: add support for pmr735b regulators
Add RPMH regulators exposed by Qualcomm Technologies, Inc. PMR735B PMIC.
It has 12 LDOs with 2 different types, L4 & L10 are LDO512 LV PMOS
and the rest are LDO512 NMOS.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://patch.msgid.link/20250711-pm7550-pmr735b-rpmh-regs-v2-3-bca8cc15c199@fairphone.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-13 22:37:08 +01:00
Michael Walle
b30d390812
regulator: tps6594-regulator: Add TI TPS652G1 PMIC regulators
The TI TPS652G1 is a stripped down version of the TPS65224 PMIC. It
doesn't feature the multiphase buck converter nor any voltage
monitoring. Due to the latter there are no interrupts serviced. In case
of the TPS652G1 any interrupt related setup is just skipped.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250703113153.2447110-9-mwalle@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-10 12:10:04 +01:00
Michael Walle
e64ee27abf
regulator: tps6594-regulator: refactor variant descriptions
Instead of using conditionals or tri state operators throughout the
.probe() provide a description per variant. This will make it much
easier to add new variants later.

While at it, make the variable naming more consistent.

This patch is only compile-time tested.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250703113153.2447110-8-mwalle@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-10 12:10:03 +01:00
Michael Walle
180a135eaf
regulator: tps6594-regulator: remove hardcoded buck config
Commit 00c826525f ("regulator: tps6594-regulator: Add TI TPS65224 PMIC
regulators") added support for the TPS65224 and made the description of
the multi-phase buck converter variable depending on the variant of the
PMIC. But this was just done for MUTLI_BUCK12 and MULTI_BUCK12_34
configs probably because this variant only supports a multi-phase
configuration on buck 1 and 2. Remove the hardcoded value for the
remaining two configs, too as future PMIC variants might also support
these.

This is a preparation patch to refactor the regulator description and
is compile-time only tested.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250703113153.2447110-7-mwalle@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-10 12:10:02 +01:00
Michael Walle
16d1a9bf36
regulator: tps6594-regulator: remove interrupt_count
In .probe() interrupt_count and nr_types is essentially the same. It
contains the number of different interrupt per LDO or buck converter.
Drop one. This is a preparation patch to further simplify the handling
of different variants of this PMIC.

This patch is only compile-time tested.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20250703113153.2447110-6-mwalle@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-10 12:10:01 +01:00
Jisheng Zhang
5054740e00
regulator: sy8827n: make enable gpio NONEXCLUSIVE
On some platforms, the sy8827n enable gpio may also be used for other
purpose, so make it NONEXCLUSIVE to support this case.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://patch.msgid.link/20250629095716.841-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-07 23:32:39 +01:00
Sebastian Reichel
61b8c39deb Runtime PM updates related to autosuspend for 6.17
Make several autosuspend functions mark last busy stamp and update
 the documentation accordingly (Sakari Ailus).
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmhjrvQSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1aigIAKypscFSfd/WsAlP4orLtd4xiLi7KQHa
 NrOYv7sZBVHgx4S9BGqHavYM3qhOBH5qCg+yBtqb8v6vp/TIlJjF2v3+C8uAXAnl
 9GI5Gc6sZp/lMhf5Vb4Ibf58/P9lg4A7mIvM+LtfeEUMTlRrp47Q/RQ0ah7S4tDj
 rFyC92QmBnkDLoyQp5IbCWkdjlqGgyTZzz/+XnfV9fWwX1aiXqaB4EZ2nXSAlyBx
 awvA4/t662SWlHsdQqll9vS/+ZB39LEWwa1jJ7XGIK8t6GSH+TTys3S9/PHR/ua3
 Dlcd+14plDGlSOy97hY+z6NdSgxH/qcpRgFduu5KwVqEwo2fqNkeV9Q=
 =pFYw
 -----END PGP SIGNATURE-----

Merge tag 'pm-runtime-6.17-rc1'

Runtime PM updates related to autosuspend for 6.17

Make several autosuspend functions mark last busy stamp and update
the documentation accordingly (Sakari Ailus).

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-07-07 00:53:35 +02:00
Mark Brown
769fced943
treewide: Remove redundant
Merge series from Sakari Ailus <sakari.ailus@linux.intel.com>:

Late last year I posted a set to switch to __pm_runtime_mark_last_busy()
and gradually get rid of explicit pm_runtime_mark_last_busy() calls in
drivers, embedding them in the appropriate pm_runtime_*autosuspend*()
calls. The overall feedback I got at the time was that this is an
unnecessary intermediate step, and removing the
pm_runtime_mark_last_busy() calls can be done after adding them to the
relevant Runtime PM autosuspend related functions. The latter part has
been done and is present in Rafael's tree at the moment, also see
<URL:https://lore.kernel.org/linux-pm/CAJZ5v0g7-8UWp6ATOy+=oGdxDaCnfKHBG_+kbiTr+
+VeuXZsUFQ@mail.gmail.com/>:

        git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
                pm-runtime-6.17-rc1
2025-07-04 16:55:48 +01:00
Sakari Ailus
c61e94e5e4
regulator: stm32-vrefbuf: Remove redundant pm_runtime_mark_last_busy() calls
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/20250704075444.3221445-1-sakari.ailus@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-07-04 13:09:53 +01:00
Manivannan Sadhasivam
c9764fd88b
regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods
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: d6cd33ad71 ("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-07-03 12:22:35 +01:00
Jisheng Zhang
6729c134cc
regulator: mp886x: Fix ID table driver_data
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-30 16:06:40 +01:00
Jisheng Zhang
f172ffde18
regulator: sy8824x: Fix ID table driver_data
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-30 16:06:39 +01:00
Jisheng Zhang
427ceac823
regulator: tps6286x-regulator: Enable REGCACHE_MAPLE
Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20250629095107.804-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-30 12:15:40 +01:00
Jisheng Zhang
b402dfe840
regulator: tps6287x-regulator: Enable REGCACHE_MAPLE
Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20250629095822.868-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-30 12:15:39 +01:00
Jisheng Zhang
bd7c7976f9
regulator: rt5739: Enable REGCACHE_MAPLE
Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20250629094803.776-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-30 12:15:38 +01:00
Shree Ramamoorthy
eeca209124
regulator: tps65219: Fix devm_kmalloc size allocation
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: 38c9f98db2 ("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-29 22:10:41 +01:00
Alessandro Carminati
ca46946a48
regulator: core: fix NULL dereference on unbind due to stale coupling data
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-29 22:10:41 +01:00
Mark Brown
53e1d4a8a2
regulator: dvfsrc: Add support for MT8196 and
Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This series adds support for the DVFSRC regulators found on the MediaTek
MT8196 Chromebook SoC and the (unrelated) MT6893 Dimensity 1200.
2025-06-23 17:56:32 +01:00
AngeloGioacchino Del Regno
024f39fff6
regulator: mtk-dvfsrc: Add support for MediaTek MT8196 DVFSRC
The MediaTek MT8196 Chromebook SoC features one DVFSRC regulator
with 6 voltage steps.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250623120144.109359-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 13:12:31 +01:00
AngeloGioacchino Del Regno
7aafbb463b
regulator: mtk-dvfsrc: Add support for Dimensity 1200 MT6893
The MediaTek Dimensity 1200 (MT6893) features the same DVFSRC
regulators as the other currently supported SoCs, but with a
different select value: add an array describing the possible
voltages for the VCORE and VSCP regulators, and assign it to
a new compatible for this SoC.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250623120144.109359-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 13:12:29 +01:00
Primoz Fiser
19cbc930c2
regulator: pca9450: Support PWM mode also for pca9451a
Previous commit 548d770c33 ("regulator: pca9450: Add support for mode
operations") added support for setting forced PWM mode on the buck
regulators for pca9450a and pca9450bc parts. However part pca9451a also
supports this feature, thus add support for it.

Fixes: 548d770c33 ("regulator: pca9450: Add support for mode operations")
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Link: https://patch.msgid.link/20250618063339.2508893-1-primoz.fiser@norik.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-23 00:27:07 +01:00
Sebastian Reichel
ceed136304 regulator: act8865-regulator: switch psy_cfg from of_node to fwnode
In order to remove .of_node from the power_supply_config struct,
use .fwnode instead.

Link: https://lore.kernel.org/r/20250430-psy-core-convert-to-fwnode-v2-1-f9643b958677@collabora.com
Reviewed-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-06-22 01:39:51 +02:00
Dave Stevenson
3e1c01d06e
regulator: rpi-panel-v2: Add shutdown hook
Add shutdown hook so that the panel gets powered off with the system.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20250616154018.430004-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-17 12:50:30 +01:00
Heiko Stuebner
8acfb165a4
regulator: fan53555: add enable_time support and soft-start times
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-16 13:26:23 +01:00
Marek Vasut
a4eb71ff98
regulator: rpi-panel-v2: Fix missing OF dependency
Add missing OF dependency and drop of_match_ptr() use.
This fixes the following LKP report:

"
>> drivers/regulator/rpi-panel-v2-regulator.c:95:34: warning: 'rpi_panel_v2_dt_ids' defined but not used [-Wunused-const-variable=]
    static const struct of_device_id rpi_panel_v2_dt_ids[] = {
                                     ^~~~~~~~~~~~~~~~~~~
"

Fixes: d49305862f ("regulator: rpi-panel-v2: Add regulator for 7" Raspberry Pi 720x1280")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506100440.fyTGO7CG-lkp@intel.com/
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20250609223012.87764-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-11 12:46:06 +01:00
Matti Vaittinen
55d9fd9819
regulator: bd718x7: Clarify comment by moving it
The BD718x7 needs to disable voltage monitoring for a duration of
certain voltage changes.

The comment explaining use of msleep(1) instead of a more accurate
delay(), was placed to a function which disabled the protection. The
actual sleeping is done in a different place of the code, after the
voltage has been changed.

Browsing through the comment and code after the years made me to scratch
my head for a second. I may have figured why me and so many fellow
developers are slowly getting bald.

Clarify things a bit and move the comment about required delay directly
above the sleep. Leave only a small comment explaining why the protection
is disabled to the spot where the logic for disabling is.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/a90cb77e66a253f4055bbb99672dc81c7457de66.1749533040.git.mazziesaccount@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-11 12:46:05 +01:00
Marek Vasut
d6fa0ca959
regulator: rpi-panel-v2: Add missing GPIOLIB dependency
Add missing GPIOLIB dependency reported by the LKP test robot.
This fixes the following report:

"
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for GPIO_REGMAP when selected by REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2
   WARNING: unmet direct dependencies detected for GPIO_REGMAP
     Depends on [n]: GPIOLIB [=n]
     Selected by [y]:
     - REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2 [=y] && REGULATOR [=y] && I2C [=y]
"

Fixes: d49305862f ("regulator: rpi-panel-v2: Add regulator for 7" Raspberry Pi 720x1280")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506092341.enbNKMOR-lkp@intel.com/
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20250609200242.31271-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-09 21:09:56 +01:00
Dave Stevenson
d49305862f
regulator: rpi-panel-v2: Add regulator for 7" Raspberry Pi 720x1280
Add regulator for the 7" Raspberry Pi 720x1280 DSI panel based on ili9881.
This is the Raspberry Pi DSI Panel V2. The newer Raspberry Pi 5" and 7"
panels have a slightly different register map to the original one. Add a
new driver for this "regulator" chip, this time by exposing two GPIOs and
one PWM controller, both of which can be consumed by panel driver and
pwm-backlight respectively.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20250609000748.1665219-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-09 13:06:29 +01:00
Martijn de Gouw
548d770c33
regulator: pca9450: Add support for mode operations
Make the PWM mode on the buck controllers configurable from
devicetree. Some boards require forced PWM mode to keep the supply
ripple within acceptable limits under light load conditions.

Signed-off-by: Martijn de Gouw <martijn.de.gouw@prodrive-technologies.com>
Link: https://patch.msgid.link/20250525071823.819342-2-martijn.de.gouw@prodrive-technologies.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:35:16 +01:00
Christophe JAILLET
9bb3c7df54
regulator: tps6594-regulator: Remove a useless static qualifier
There is no point in having 'npname' a static variable. So remove the
static qualifier. This is cleaner and saves a few bytes.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  27949	  12176	     64	  40189	   9cfd	drivers/regulator/tps6594-regulator.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  27947	  12112	      0	  40059	   9c7b	drivers/regulator/tps6594-regulator.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/ebc53d4049ec19796ef07e1bb734de19a2814727.1748103005.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:35:14 +01:00
Christophe JAILLET
c266209eae
regulator: tps6594-regulator: Constify struct tps6594_regulator_irq_type
'struct tps6594_regulator_irq_type' are not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  25645	  14480	     64	  40189	   9cfd	drivers/regulator/tps6594-regulator.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  27949	  12176	     64	  40189	   9cfd	drivers/regulator/tps6594-regulator.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/1446fb1938f3f38115be3e53f5dda3c8bb0ba5a1.1748103005.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-08 23:35:13 +01:00
Dan Carpenter
06118ae368
regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()
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: 6b0cd72757 ("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-08 23:29:48 +01:00
Linus Torvalds
d7582bb0a4 regulator: Fix for v6.16
A very minor fix that came in during the merge window, checking for I/O
 errors in the MAX14577 driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmhBmiMACgkQJNaLcl1U
 h9A5sAf9F/hOszrNv4Css2Md5h2nYNg+GY/cWOK4wIaVBxXG0OSqJZMVoqyYn+tj
 Wb9OJf11CSoC7OSfG/pgN6W61leWmZ97HCs6tAkkuCm9DdklHB7i5yz2oedliG7e
 fx2a6FYsIzGMN5i/+57bQxmNjIiHgioK1A+s2pDru6TyHucTDdwUBPWIemnjoCEV
 mpSdlmSxIhyoWapE+Ur4L5lHBATWKl98TjxO6lzIaqJmFe16jZpwZY8sXY0q9+qV
 Lg+W+EAFs6pna6l0FY6lnriAlUSBJDMgTa0aM3cpvX9RwBnH9Z+V4ebjkSXJ8CJA
 sXFWoQvdPGdt/Dxez5qnldpTioldGw==
 =m+cK
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v6.16-merge-window' of 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-06 13:20:26 -07:00
Linus Torvalds
69352bd52b MFD for v6.16
* 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmg+xmQACgkQUa+KL4f8
 d2FJAxAApmk3kxAlb9r6E268SY1qQSeQKhhzQZeQz1Dt9ZfMurgnou+EdY5juxCH
 owu4AjyQdaC/eIJJRaBcBjcskmNRsVd7mGwQfhMyg7IvhM9k1PxTuad/PSRauGqy
 p7XnYFYeDa9fwwAZ8qD01gpCenQ3oLm4ef05FGC5SDlqcZzxOzc4iGYgHYjE7ACp
 Iuv5tN0JkxCzTGtpZ6kXn5tp895KcndzPWgS0eQxf6Plw2syF0KKxlVCWUfLjAaZ
 Db1VFOkc2vgjhxuFPpybGzRhgtVKRdYRJqL4EQEhnB/u23cuxxqBSJ3BPGIjfqrA
 h6zaxbYJyBF3cHz9kOqi99inN4T3cZssOSdqIVuWTYSuH+FDdsVi5BF2WlrSgWqn
 hgyVZYjMEB4UbEU+0VdZMqTWjY0+kmAEl7xWQ++sp2cuTtYdcufrldLVl0d/HOCm
 zLXia1A2KHgFoBFN/sP0ffZD9ceM/ng1h1tfz+48MWWO7obpwbdFNtWllblfpm9d
 cYPlg0uddFljjzP/gm3jgJAZkMer2m5eSVfvf2L5VrSROFSfbxwHcvVgRTxmPR0K
 1rQqLm1w2Tp8HCocuO95bRv5g0Z4jWDu+CssM1XZrEXaNCZ5E0qm374JArpAFctb
 cAVFcLYSUT73S6lgBOjF05F2zGPCmqW26S+R2cMPcM2SA1N89Go=
 =hiAm
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.16' of 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-06-03 11:53:55 -07:00
Linus Torvalds
350d9ab736 regulator: Updates for v6.16
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.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmgzBksACgkQJNaLcl1U
 h9DfSQf+KAyyETqQ504yew2Yin0jdPsHrlrPw9OmK/4gwk9DNvzAELGBqolQWaEV
 vDaLniVbqDoFDZECDKfKHPkw1GRjo8CUd1JaMcEv+cUHvdO7cyRR/44Kguuc78Q7
 nkaBrgyYA9iK+3hH3t7aK4oKHcLzAcdrFHgAIm5P0mld0pr1UrQmYlsQpvEEAhEb
 TpxT+9V04DjPbpyNC4k0GCvJS1EXaS2X3kjKnowTSylCdxxGC7HbQK1QX0OSEvWV
 5wJz+46bmcjAggf4PM8DlFtLCmLdMlb2+g0iNfikwvvBVBe0fhDW657apSTq18XS
 +K9bnCEupseehFA/r+gjh1EFjFWPLQ==
 =QoGH
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v6.16' of 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-27 15:49:58 -07:00
Wentao Liang
65271f868c
regulator: max14577: Add error check for max14577_read_reg()
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: b0902bbeb7 ("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-26 14:01:29 +01:00
Lee Jones
18e6c1d2a7 Merge branches 'ib-firmware-mfd-6.16', 'ib-mfd-clocksource-pwm-6.16', '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-22 15:49:34 +01:00
Artur Weber
ef7f3631a4 regulator: bcm590xx: Add support for BCM59054 regulators
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-22 10:57:46 +01:00
Artur Weber
d92f474420 regulator: bcm590xx: Rename BCM59056-specific data as such
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-22 10:57:36 +01:00