[PATCH 2/2] media: i2c: ak7375: Do not mark the VCM active before powering it

From: Jan-Michael Brummer

Date: Sat Aug 29 2026 - 01:36:04 EST


probe() calls pm_runtime_set_active() while the regulators are still
off, so runtime PM believes a powered device is present. The following
pm_runtime_idle() runs the suspend path against an unpowered chip, which
fails its I2C writes and then calls regulator_bulk_disable() on
regulators that were never enabled - later tripping the enable/disable
balance check in regulator_bulk_free() on unbind.

Mark the device suspended instead and drop the idle call, so the first
resume happens when something actually uses the VCM. While at it,
disable the regulators again when resume fails, which leaked an enable
count for the same reason.

Fixes: 90ee26fb2f50 ("media: ak7375: Add ak7375 lens voice coil driver")
Signed-off-by: Jan-Michael Brummer <jan.brummer@xxxxxxxxx>
---
drivers/media/i2c/ak7375.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c
index 4f311c4..2763bbe 100644
--- a/drivers/media/i2c/ak7375.c
+++ b/drivers/media/i2c/ak7375.c
@@ -235,9 +235,12 @@ static int ak7375_probe(struct i2c_client *client)
if (ret < 0)
goto err_cleanup;

- pm_runtime_set_active(&client->dev);
+ /*
+ * The regulators are off at this point, so the device is suspended,
+ * not active.
+ */
+ pm_runtime_set_suspended(&client->dev);
pm_runtime_enable(&client->dev);
- pm_runtime_idle(&client->dev);

return 0;

@@ -328,6 +331,8 @@ static int __maybe_unused ak7375_vcm_resume(struct device *dev)
cdef->mode_active, 1);
if (ret) {
dev_err(dev, "%s I2C failure: %d\n", __func__, ret);
+ regulator_bulk_disable(ARRAY_SIZE(ak7375_supply_names),
+ ak7375_dev->supplies);
return ret;
}