media: dw9807-vcm: The device is not active initially 30/293330/1
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Wed, 4 Jan 2023 10:16:08 +0000 (10:16 +0000)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 22 May 2023 08:02:36 +0000 (17:02 +0900)
The probe calls pm_runtime_set_active in the probe, but
has never called dw9807_vcm_resume.
Without a regulator this causes no issue as it just
instructs the VCM to move to the idle position and power
down. With a regulator the pm_runtime_idle calls
dw9807_vcm_suspend, and we get a mismatch in the regulator framework.

Make the active state conditional on having a regulator.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
[sw0312.kim: cherry-pick raspberry pi kernel upstream to support rpi camera module v3]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I3bec010f791f78caf223d74eff9f327a92383988

drivers/media/i2c/dw9807-vcm.c

index 3589d0b..c9fa79a 100644 (file)
@@ -371,7 +371,8 @@ static int dw9807_probe(struct i2c_client *client)
        if (rval < 0)
                goto err_cleanup;
 
-       pm_runtime_set_active(&client->dev);
+       if (!dw9807_dev->vdd)
+               pm_runtime_set_active(&client->dev);
        pm_runtime_enable(&client->dev);
        pm_runtime_idle(&client->dev);