Re: [PATCH V1 2/3] accel/amdxdna: Add configuring low and medium power mode

Mario Limonciello
2026-04-24T13:29:07Z

> From: Nishad Saraf <nishads@amd.com>
>
> Add support for POWER_MODE_LOW and POWER_MODE_MEDIUM.
>
> Signed-off-by: Nishad Saraf <nishads@amd.com>
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> drivers/accel/amdxdna/aie2_pm.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/accel/amdxdna/aie2_pm.c b/drivers/accel/amdxdna/aie2_pm.c
> index d9ccd7fc8a6d..4fe6030d2c41 100644
> --- a/drivers/accel/amdxdna/aie2_pm.c
> +++ b/drivers/accel/amdxdna/aie2_pm.c
> @@ -108,6 +108,14 @@ int aie2_pm_set_mode(struct amdxdna_dev_hdl *ndev, enum amdxdna_power_mode_type
> clk_gating = AIE2_CLK_GATING_ENABLE;
> dpm_level = ndev->dft_dpm_level;
> break;
> + case POWER_MODE_LOW:
> + clk_gating = AIE2_CLK_GATING_ENABLE;
> + dpm_level = 0;
> + break;
> + case POWER_MODE_MEDIUM:
> + clk_gating = AIE2_CLK_GATING_ENABLE;
> + dpm_level = ndev->max_dpm_level / 2;
> + break;
> default:
> return -EOPNOTSUPP;
> }