As there is no interface to power off vpu core.
So it need to boot from cold on first load.
but on the second load, driver need to restore the status
instead of booting.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
}
list_add_tail(&core->list, &vpu->cores);
-
vpu_core_get_vpu(core);
- if (vpu_iface_get_power_state(core))
- ret = vpu_core_restore(core);
- if (ret)
- goto error;
-
return 0;
error:
if (core->msg_buffer) {
pm_runtime_resume_and_get(core->dev);
if (core->state == VPU_CORE_DEINIT) {
- ret = vpu_core_boot(core, true);
+ if (vpu_iface_get_power_state(core))
+ ret = vpu_core_restore(core);
+ else
+ ret = vpu_core_boot(core, true);
if (ret) {
pm_runtime_put_sync(core->dev);
mutex_unlock(&core->lock);