Commit 9059ca92 authored by Ming Qian's avatar Ming Qian Committed by Mauro Carvalho Chehab
Browse files

media: amphion: support for reloading module



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: default avatarMing Qian <ming.qian@nxp.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent f4334c51
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -257,14 +257,8 @@ static int vpu_core_register(struct device *dev, struct vpu_core *core)
	}

	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) {
@@ -362,6 +356,9 @@ struct vpu_core *vpu_request_core(struct vpu_dev *vpu, enum vpu_core_type type)
	pm_runtime_resume_and_get(core->dev);

	if (core->state == VPU_CORE_DEINIT) {
		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);