Re: [PATCH v2 2/7] media: iris: move shared APV PM helpers to iris_vpu_common

From: Dmitry Baryshkov

Date: Fri Oct 02 2026 - 11:52:07 EST


On Wed, Sep 23, 2026 at 11:27:52AM +0800, Wangao Wang wrote:
> The APV power on/off sequences and AHB bridge sync reset helpers are
> currently local to iris_vpu4x.c. VPU5x uses the same sequences, so keeping
> them in the VPU4x implementation would either prevent reuse or require
> duplicating the code.
>
> Move the helpers to iris_vpu_common.c and rename them with a vpu4x_vpu5x
> prefix to reflect their shared usage.
>
> Move the associated register constants, including APV_CLK_HALT, the efuse
> control bits, CPU_CS_APV_BRIDGE_SYNC_RESET, WRAPPER_EFUSE_MONITOR, and
> AON_WRAPPER_MVP_NOC_RESET_SYNCRST, to iris_vpu_register_defines.h so both
> implementations can use them.
>
> Signed-off-by: Wangao Wang <wangao.wang@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/iris_vpu4x.c | 105 +--------------------
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 91 ++++++++++++++++++
> drivers/media/platform/qcom/iris/iris_vpu_common.h | 4 +
> .../platform/qcom/iris/iris_vpu_register_defines.h | 10 ++
> 4 files changed, 109 insertions(+), 101 deletions(-)
>
> @@ -249,7 +152,7 @@ static int iris_vpu4x_power_on_hardware(struct iris_core *core)
> goto disable_vpp1_power_domain;
>
> if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) {
> - ret = iris_vpu4x_power_on_apv(core);
> + ret = iris_vpu4x_vpu5x_power_on_apv(core);

I think it's fine to keep the vpu4x in the names, even if they apply to
the later generations. If (just an imagination) they also apply to vpu6x
(or worse, only to some of vpu6x), we definitely don't need another
rename to (again, imagination), iris_vpu4x_vpu5x_vpu62_vpu64_power_on_apv()

> if (ret)
> goto disable_hw_clocks;
> }

--
With best wishes
Dmitry