5 Commits

Author SHA1 Message Date
Felix Gu
0902010c8d regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read()
In fp9931_hwmon_read(), if regmap_read() failed, the function returned
the error code without calling pm_runtime_put_autosuspend(), causing
a PM reference leak.

Fixes: 12d821bd13 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260224-fp9931-v1-1-1cf05cabef4a@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-02-24 17:31:54 +00:00
Felix Gu
e3b76494d6 regulator: fp9931: Add missing memory allocation check
Add a check for devm_kzalloc failure in fp9931_probe to prevent a
null pointer dereference.

Fixes: 12d821bd13 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <gu_0233@qq.com>
Link: https://patch.msgid.link/tencent_5FCF2108621C51007E5526A7C60A5CC1F306@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-01-19 14:42:02 +00:00
Andreas Kemnade
60489936ac regulator: fp9931: fix regulator node pointer
Sync the driver with the binding. During review process a regulators
subnode was requested but neither driver nor test setup was updated.

Fixes: 12d821bd13 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251223-fp9931-fix-v1-1-b19b4c1e7056@kemnade.info
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-12-24 11:31:29 +00:00
Colin Ian King
81d431130a regulator: fp9931: Fix spelling mistake "failid" -> "failed"
There is a spelling mistake in a dev_err_probe message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20251128173330.318309-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-28 18:07:46 +00:00
Andreas Kemnade
12d821bd13 regulator: Add FP9931/JD9930 driver
Add a driver for the FP9931/JD9930 regulator. Implement handling of the PG
(power good), TS_EN (temperature sensor enable), and EN (enable regulators)
pins. Implement the pair of symmetric LDOs as a single regulator because
they share a single voltage set register. For simplicity, just add the
temperature sensor (depending on external NTC) directly.

Limitations:
- As these regulators are controlled together with the VCOM regulator via
  the EN pin, some kind of management must be in place. As the enable op
  is not called when the regulator is already enabled, simple refcounting
  seems not to work to avoid clearing EN when one regulator is still
  enabled. As these regulators are typically used together, this
  limitation should not hurt hard, just provide the is_enabled op.
- As the VCOM step is quite odd (5V/255 steps), rounding is needed.
  Due to some limitations in the regulator core, the max/min voltages in
  the devicetree must match the idea of the driver how to round things
  exactly.
- Night mode is not implemented, so only the FP9931 compatible is needed in
  the driver, there is no REGULATOR_MODE_NIGHT and no clear definition in
  the datasheet what it does, also the XON pin which seems to be an input
  related to that night mode is not used.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251115-fp9931-submit-v3-3-92f5d0772b68@kemnade.info
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-20 16:29:17 +00:00