From nobody Fri Apr 3 06:26:52 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 707963932D1 for ; Fri, 13 Mar 2026 13:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408020; cv=none; b=a4Ha1niW4GDQ7oko6Vl9EEBoyUXtBXUk1JHy26UXH1ED0OgQSUdntEtxwGgmuhR5w1Cp/+rgtFwycoR6pqWkHCVJa7ukkD7oQ5p3mD0i1MeNuvm8NGspXnuCTtPbFQ819eYdp33UgDYZmIGoncdCcP0K2GIzf98m7PYyN48aqtE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408020; c=relaxed/simple; bh=dZJYP9WEQ15bASoAnqkMaYb7rJt/AK30AeIqIM/eNVY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=udWBvfcebR1eic1k3CCHSQSvKPVoCnC/ss7G5izEoDrQb6Nd4GOIePINZv72U6FcR2O3XUiDM1ujoTpqwk+8Bu4WmrbUdod0hWgGV0Uir0NcIsG1QcIJ1yYZCYJf9ER5JQgmN1lXeP1uLwXXEdtFp8CfaGjMzT3Ym7npVNbJSMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Z34u0Li5; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kVHrwTXj; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Z34u0Li5"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kVHrwTXj" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62D7JUQa240711 for ; Fri, 13 Mar 2026 13:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OmooHTNlhAxzzz79GxcazkpjxnhgXFY3NaOnQdYSmOE=; b=Z34u0Li5ESgoIRNm IuOM16sw0lMu/kMZtF2E0MLyMGTw702aKw54VyAXQXGveWcMuPwHy3EwbYhnvG/w uDH7OhSj/CsqA1oiTJFKdE9nHePEvke6JT+cF+BzmIz3vpHs7c6/uk6vPRzCxug7 +NVyM2kJdkcpu5m8uhvogw0PeVR1RmgTOdwHCqLzwgdyOWftpsjWITo/NR46a1gS H9i0DYMpsUnhE6dKF0alNcRxtvdgiycL+rHYpV5Ax7gLVhgVrMMJbiuUcUcCuOjd 5rghXYlyCcZbtb3lGpVK9VsS6C2S1hxdv0rUiBm5J5O/qrdQZwYg9aaZDoBrVSwu POwBBA== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cve3d983d-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 13 Mar 2026 13:20:17 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-82a106b687cso642694b3a.1 for ; Fri, 13 Mar 2026 06:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773408017; x=1774012817; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OmooHTNlhAxzzz79GxcazkpjxnhgXFY3NaOnQdYSmOE=; b=kVHrwTXj7avSUzwfi6kHdewWmUzIXlMHbX9qTm7P0yChG34Qq5tu1ya7ZvVSFSlvbk /X/EYhjbQaBSeGQuol8gOTJlsmKwp15mCJ2Ja3/HMFhnliRDWQFmYSDyqJUaNLe9pW2m ewVx3IodAo+kREbIvcJ+KVl/AQKusH0sWUrTqDs9c6aeI7UqL8+TY2nBYpjSEdX/aY/2 6eruhMS6T5S9B1XPLKgKFbEoKfrAtmUv4yoR1K2CBSgqj+bzXvx63xY/cq8Zo2of1JTA do4qApLB8hb4cH+MufLeMvWPLy9F/m78kxd9e4I59Q5R1g4UsdWXWqOwL6O+gvbaPjMD lsgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408017; x=1774012817; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OmooHTNlhAxzzz79GxcazkpjxnhgXFY3NaOnQdYSmOE=; b=A7NXWF1hkz52699w8eXoG+nY3+nltwn98mhHeHIeu/fW3v0QJKl7tDjTu3zXyZJy40 M2KbrM0C/K1Flig/IUQ9q1eeootDh9OPGLNdcZzslygpV/Fhuw5VVt2oyf1ez7+T6QP5 ttCMGywQ2z8Dgt+oTFwrj3lj4QIwUm57dhxSjIrt9UcFHYIG1vjdFGBgNgz2wKWHhBtA PpuEoYp9EnJ/az16Jf2z+JnJozxeLCQvJ3pa38IUT/eugJxtEnioAsBQ942hckrMNK8x +p3gbewPUZ2cUtNH+byZgOEGBjgCJujEbYYbbkJKP0vSDlLXvx4q9u5Uew64dEgUFiaG nChg== X-Forwarded-Encrypted: i=1; AJvYcCWoUMBC+UIwA0tVswaY03fOisM8gU73HUID+Hq4rl3BrF9CsxEN3YGI+/RIr6xEzJUhruLVbJwMWTOgHCU=@vger.kernel.org X-Gm-Message-State: AOJu0YzhgjqdjZZqOOuGmuegMFB8Y4xwOhRjLlMLNazrBuMoqOMAREhL L3ih6gDxUL1Qzu/oKykkwMfAohVgC2gwpPNDYylZh1NJ0XZkUYRcn5Vdy/zFmn4j2NY1/jH9xKP M4PFGT3379Axbx7xdGzMC0uNE06WtbmvOP/ymnMrMd229tv9RJ2twrSw+kRuJrOXYEnc= X-Gm-Gg: ATEYQzw3Ue9coc2s6YmK/ePH4YbAISL+Rkz964lI2CpFEPSj/3paB/EgoLy2i29B4Rt NUfS7DHrYhmMUO3Ow3VBkaWFWsMhXJ8Y1MjatKMKr+EG8a8RzmDLerhAcvtMQYBzprn4tG1nDqc HnxFWwDt4wcdTjdymchwvXR+oAUwnynSFnE/uIN9NZj70xFnWDggEwCmyBffbp2aaFWR3CMGHK+ BRHE0CZDMWbxu11DTnaGKfdetBs0gXNSVpYZJMeFphdoTlFwad6i8AFJ904RqFCJQ2sIyyOST1W jykSuggVhpiKKAJ2d9ZLgbCTafuqW4cqZ6xdB/N05rXp1Jwl05fBIzPr7wOI3QPneiYJHMoWqYi WhHU6Zwo3MiFRMDKa+2IliypkZYFATv+Gg0eZoLopjBFzkEl9M8rYQBTx X-Received: by 2002:a05:6a00:1143:b0:829:809e:8978 with SMTP id d2e1a72fcca58-82a198ac2eamr2998229b3a.31.1773408017007; Fri, 13 Mar 2026 06:20:17 -0700 (PDT) X-Received: by 2002:a05:6a00:1143:b0:829:809e:8978 with SMTP id d2e1a72fcca58-82a198ac2eamr2998159b3a.31.1773408016318; Fri, 13 Mar 2026 06:20:16 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82a0724407csm5775254b3a.8.2026.03.13.06.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:20:15 -0700 (PDT) From: Vikash Garodia Date: Fri, 13 Mar 2026 18:49:36 +0530 Subject: [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-kaanapali-iris-v3-2-9c0d1a67af4b@oss.qualcomm.com> References: <20260313-kaanapali-iris-v3-0-9c0d1a67af4b@oss.qualcomm.com> In-Reply-To: <20260313-kaanapali-iris-v3-0-9c0d1a67af4b@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov , Conor Dooley , Saravana Kannan , Joerg Roedel , Will Deacon , Robin Murphy , Stefan Schmidt , Hans Verkuil , Krzysztof Kozlowski , Vishnu Reddy , Hans Verkuil Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Bryan O'Donoghue , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773407994; l=9412; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=dZJYP9WEQ15bASoAnqkMaYb7rJt/AK30AeIqIM/eNVY=; b=JPM42i6HYMeN1rTAZwvIJg6/sMISA1Gma2fLPmxEZi0liOvAOhQUMfOHrK0SRPLh+tfcPnp7f jAe1bTI8VoICi6TJ22PSn57UUCgsB8IBIvTbISX+zajC2OL7+JKRnyl X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-ORIG-GUID: IAUrfZnKumnpz_q-A64aJuty0NdD8gCD X-Authority-Analysis: v=2.4 cv=FLwWBuos c=1 sm=1 tr=0 ts=69b40f11 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=gUug7MfHRhSEeGGeBFwA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEzMDEwNiBTYWx0ZWRfX458Jeen9nUiF IZI6k/wiT8lBkEIzZf+HQTI4eofeXIO4QYGamEFShqIjtIKu3BzZw7qdQZYXJPMCtNrz7XhdUoZ nZIq9zzbWQQ+yFYBH4YEVo3NpkebOjx96gP4/6M4JzUxpmkGP72QmRYxzRC0qvaJVU1EdsBAObt Il/uAflGAH6WAYmStRNhcyXS9G6zUHjjqPg5ejiskM0Yhaqhm27OBRZwCARmQtcZCwoEl2lWbNk trW/MU9fsoKMz1hFOUUGk35Yr4dinIqIhEfNbl5YFkMOQjMmiWjOni6as/YIQsSr5hkec1J5BZ0 +MWHNhWKXmKTuOTF6O4mQh2/+aNGS9/0PfOhrRJTK4RFGOVY41E90HLzQoCzpMVi4rWXPWdjd9/ X2yUq69SWp7e0MOWuA0XJ0Zkt/Sr9K69RQ0iq4ymARWhamJFkCMJED0FSU+CUvJSMsvNdmuve+9 wO6MQJLbOoafNP0ffCA== X-Proofpoint-GUID: IAUrfZnKumnpz_q-A64aJuty0NdD8gCD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-13_02,2026-03-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 malwarescore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603130106 Currently the driver switches the vcodec GDSC to hardware (HW) mode before firmware load and boot sequence. GDSC can be powered off, keeping in hw mode, thereby the vcodec registers programmed in TrustZone (TZ) carry default (reset) values. Move the transition to HW mode after firmware load and boot sequence. The bug was exposed with driver configuring different stream ids to different devices via iommu-map. With registers carrying reset values, VPU would not generate desired stream-id, thereby leading to SMMU fault. For vpu4, when GDSC is switched to HW mode, there is a need to perform the reset operation. Without reset, there are occassional issues of register corruption observed. Hence the vpu GDSC switch also involves the reset. Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with necessar= y hooks") Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Reviewed-by: Dikshita Agarwal Reviewed-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_core.c | 4 ++++ drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 ++++ drivers/media/platform/qcom/iris/iris_vpu2.c | 1 + drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 +++----- drivers/media/platform/qcom/iris/iris_vpu4x.c | 24 ++++++++++++------= ---- drivers/media/platform/qcom/iris/iris_vpu_common.c | 16 +++++++++------ drivers/media/platform/qcom/iris/iris_vpu_common.h | 3 +++ 7 files changed, 38 insertions(+), 23 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.c b/drivers/media/p= latform/qcom/iris/iris_core.c index 8406c48d635b6eba0879396ce9f9ae2292743f09..dbaac01eb15a0e622e85635fddd= 29c1f7fc18662 100644 --- a/drivers/media/platform/qcom/iris/iris_core.c +++ b/drivers/media/platform/qcom/iris/iris_core.c @@ -75,6 +75,10 @@ int iris_core_init(struct iris_core *core) if (ret) goto error_unload_fw; =20 + ret =3D iris_vpu_switch_to_hwmode(core); + if (ret) + goto error_unload_fw; + ret =3D iris_hfi_core_init(core); if (ret) goto error_unload_fw; diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.c b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.c index 92112eb16c11048e28230a2926dfb46e3163aada..621c66593d88d47ef3438c98a07= cb29421c4e375 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c @@ -159,6 +159,10 @@ int iris_hfi_pm_resume(struct iris_core *core) if (ret) goto err_suspend_hw; =20 + ret =3D iris_vpu_switch_to_hwmode(core); + if (ret) + goto err_suspend_hw; + ret =3D ops->sys_interframe_powercollapse(core); if (ret) goto err_suspend_hw; diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/p= latform/qcom/iris/iris_vpu2.c index 9c103a2e4e4eafee101a8a9b168fdc8ca76e277d..01ef40f3895743b3784464e2d5b= a2de1aeca5a4a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_vpu2.c @@ -44,4 +44,5 @@ const struct vpu_ops iris_vpu2_ops =3D { .power_off_controller =3D iris_vpu_power_off_controller, .power_on_controller =3D iris_vpu_power_on_controller, .calc_freq =3D iris_vpu2_calc_freq, + .set_hwmode =3D iris_vpu_set_hwmode, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index fe4423b951b1e9e31d06dffc69d18071cc985731..3dad47be78b58f6cd5ed6f333b3= 376571a04dbf0 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -234,14 +234,8 @@ static int iris_vpu35_power_on_hw(struct iris_core *co= re) if (ret) goto err_disable_hw_free_clk; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], true); - if (ret) - goto err_disable_hw_clk; - return 0; =20 -err_disable_hw_clk: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); err_disable_hw_free_clk: iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); err_disable_axi_clk: @@ -266,6 +260,7 @@ const struct vpu_ops iris_vpu3_ops =3D { .power_off_controller =3D iris_vpu_power_off_controller, .power_on_controller =3D iris_vpu_power_on_controller, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu_set_hwmode, }; =20 const struct vpu_ops iris_vpu33_ops =3D { @@ -274,6 +269,7 @@ const struct vpu_ops iris_vpu33_ops =3D { .power_off_controller =3D iris_vpu33_power_off_controller, .power_on_controller =3D iris_vpu_power_on_controller, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu_set_hwmode, }; =20 const struct vpu_ops iris_vpu35_ops =3D { @@ -283,4 +279,5 @@ const struct vpu_ops iris_vpu35_ops =3D { .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, .program_bootup_registers =3D iris_vpu35_vpu4x_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu_set_hwmode, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index a8db02ce5c5ec583c4027166b34ce51d3d683b4e..02e100a4045fced33d7a3545b63= 2cc5f0955233f 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -252,21 +252,10 @@ static int iris_vpu4x_power_on_hardware(struct iris_c= ore *core) ret =3D iris_vpu4x_power_on_apv(core); if (ret) goto disable_hw_clocks; - - iris_vpu4x_ahb_sync_reset_apv(core); } =20 - iris_vpu4x_ahb_sync_reset_hardware(core); - - ret =3D iris_vpu4x_genpd_set_hwmode(core, true, efuse_value); - if (ret) - goto disable_apv_power_domain; - return 0; =20 -disable_apv_power_domain: - if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) - iris_vpu4x_power_off_apv(core); disable_hw_clocks: iris_vpu4x_disable_hardware_clocks(core, efuse_value); disable_vpp1_power_domain: @@ -359,6 +348,18 @@ static void iris_vpu4x_power_off_hardware(struct iris_= core *core) iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); } =20 +static int iris_vpu4x_set_hwmode(struct iris_core *core) +{ + u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); + + if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) + iris_vpu4x_ahb_sync_reset_apv(core); + + iris_vpu4x_ahb_sync_reset_hardware(core); + + return iris_vpu4x_genpd_set_hwmode(core, true, efuse_value); +} + const struct vpu_ops iris_vpu4x_ops =3D { .power_off_hw =3D iris_vpu4x_power_off_hardware, .power_on_hw =3D iris_vpu4x_power_on_hardware, @@ -366,4 +367,5 @@ const struct vpu_ops iris_vpu4x_ops =3D { .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, .program_bootup_registers =3D iris_vpu35_vpu4x_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu4x_set_hwmode, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 548e5f1727fdb7543f76a1871f17257fa2360733..69e6126dc4d95ed9e5fccf59620= 5e84ec0bfc82d 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -292,14 +292,8 @@ int iris_vpu_power_on_hw(struct iris_core *core) if (ret && ret !=3D -ENOENT) goto err_disable_hw_clock; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], true); - if (ret) - goto err_disable_hw_ahb_clock; - return 0; =20 -err_disable_hw_ahb_clock: - iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK); err_disable_hw_clock: iris_disable_unprepare_clock(core, IRIS_HW_CLK); err_disable_power: @@ -308,6 +302,16 @@ int iris_vpu_power_on_hw(struct iris_core *core) return ret; } =20 +int iris_vpu_set_hwmode(struct iris_core *core) +{ + return dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_= DOMAIN], true); +} + +int iris_vpu_switch_to_hwmode(struct iris_core *core) +{ + return core->iris_platform_data->vpu_ops->set_hwmode(core); +} + int iris_vpu35_vpu4x_power_off_controller(struct iris_core *core) { u32 clk_rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index f6dffc613b822341fb21e12de6b1395202f62cde..dee3b1349c5e869619c7f7c294d= d711f9ff72b92 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -21,6 +21,7 @@ struct vpu_ops { int (*power_on_controller)(struct iris_core *core); void (*program_bootup_registers)(struct iris_core *core); u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); + int (*set_hwmode)(struct iris_core *core); }; =20 int iris_vpu_boot_firmware(struct iris_core *core); @@ -30,6 +31,8 @@ int iris_vpu_watchdog(struct iris_core *core, u32 intr_st= atus); int iris_vpu_prepare_pc(struct iris_core *core); int iris_vpu_power_on_controller(struct iris_core *core); int iris_vpu_power_on_hw(struct iris_core *core); +int iris_vpu_set_hwmode(struct iris_core *core); +int iris_vpu_switch_to_hwmode(struct iris_core *core); int iris_vpu_power_on(struct iris_core *core); int iris_vpu_power_off_controller(struct iris_core *core); void iris_vpu_power_off_hw(struct iris_core *core); --=20 2.34.1