From fea2e9f574e7a491cf9486bee6b8b31985d15724 Mon Sep 17 00:00:00 2001 From: Lin Jinhan Date: Thu, 17 Nov 2022 11:32:57 +0800 Subject: [PATCH] media: i2c: gc2093: pm_runtime_put device until stream_off for thunderboot The camera device should keep *power on* until stream off, that make sure the mclk is enable. Signed-off-by: Lin Jinhan Change-Id: Iad14d6648b24c5e9202ba2cef2199e35fbe18fbb --- drivers/media/i2c/gc2093.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/gc2093.c b/drivers/media/i2c/gc2093.c index 0edb5bf12944..a85a2a696bab 100644 --- a/drivers/media/i2c/gc2093.c +++ b/drivers/media/i2c/gc2093.c @@ -1000,7 +1000,7 @@ static int __gc2093_stop_stream(struct gc2093 *gc2093) gc2093->has_init_exp = false; if (gc2093->is_thunderboot) { gc2093->is_first_streamoff = true; - return 0; + pm_runtime_put(gc2093->dev); } return gc2093_write_reg(gc2093, GC2093_REG_CTRL_MODE, GC2093_MODE_SW_STANDBY); @@ -1517,7 +1517,10 @@ static int gc2093_probe(struct i2c_client *client, pm_runtime_set_active(dev); pm_runtime_enable(dev); - pm_runtime_idle(dev); + if (gc2093->is_thunderboot) + pm_runtime_get_sync(dev); + else + pm_runtime_idle(dev); return 0;