media: i2c: sc230ai: pm_runtime_put device until stream_off for thunderboot

Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: If328b3af33d14fdc5309c35d6e3a222abbcb47ec
This commit is contained in:
Su Yuefu
2022-11-17 11:20:47 +08:00
committed by Tao Huang
parent 797a0b4b11
commit 660f1d040d

View File

@@ -1107,8 +1107,10 @@ static int __sc230ai_start_stream(struct sc230ai *sc230ai)
static int __sc230ai_stop_stream(struct sc230ai *sc230ai)
{
sc230ai->has_init_exp = false;
if (sc230ai->is_thunderboot)
if (sc230ai->is_thunderboot) {
sc230ai->is_first_streamoff = true;
pm_runtime_put(&sc230ai->client->dev);
}
return sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
SC230AI_REG_VALUE_08BIT, SC230AI_MODE_SW_STANDBY);
}
@@ -1744,7 +1746,10 @@ static int sc230ai_probe(struct i2c_client *client,
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
pm_runtime_idle(dev);
if (sc230ai->is_thunderboot)
pm_runtime_get_sync(dev);
else
pm_runtime_idle(dev);
return 0;