From c684975c19701ac4e92a96594c050453260dae94 Mon Sep 17 00:00:00 2001 From: Chinmay Sawarkar Date: Mon, 22 Feb 2021 13:14:15 -0800 Subject: [PATCH] video: driver: Initialize handoff_done If not initialized, power control may wrongly be transferred to firmware, even though regulator handoff is not done. Change-Id: Ic76a679ff5f848bfb50c95dc3306f05ee62bc82f Signed-off-by: Chinmay Sawarkar --- driver/vidc/src/venus_hfi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/driver/vidc/src/venus_hfi.c b/driver/vidc/src/venus_hfi.c index b1eb5fb14b..f2549c2bb8 100644 --- a/driver/vidc/src/venus_hfi.c +++ b/driver/vidc/src/venus_hfi.c @@ -1669,6 +1669,8 @@ static int __disable_regulator(struct regulator_info *rinfo, goto disable_regulator_failed; } + core->handoff_done = 0; + if (!regulator_is_enabled(rinfo->regulator)) d_vpr_e("%s: regulator %s already disabled\n", __func__, rinfo->name); @@ -2125,8 +2127,7 @@ static int __resume(struct msm_vidc_core *core) } __set_subcaches(core); - if (core->handoff_done) - __sys_set_power_control(core, true); + __sys_set_power_control(core, true); d_vpr_h("Resumed from power collapse\n"); exit: @@ -2646,6 +2647,8 @@ int venus_hfi_core_init(struct msm_vidc_core *core) return -ENOMEM; } + core->handoff_done = 0; + rc = __load_fw(core); if (rc) return rc; @@ -2678,8 +2681,7 @@ int venus_hfi_core_init(struct msm_vidc_core *core) if (rc) goto error; - if (core->handoff_done) - __sys_set_power_control(core, true); + __sys_set_power_control(core, true); d_vpr_h("%s(): successful\n", __func__); return 0;