1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
4 * Copyright 2017-2018 NXP
5 * Anson Huang <Anson.Huang@nxp.com>
8 #include <linux/cpuidle.h>
9 #include <linux/module.h>
10 #include <asm/cpuidle.h>
15 static int imx7ulp_enter_wait(struct cpuidle_device
*dev
,
16 struct cpuidle_driver
*drv
, int index
)
19 imx7ulp_set_lpm(ULP_PM_WAIT
);
21 imx7ulp_set_lpm(ULP_PM_STOP
);
25 imx7ulp_set_lpm(ULP_PM_RUN
);
30 static struct cpuidle_driver imx7ulp_cpuidle_driver
= {
31 .name
= "imx7ulp_cpuidle",
35 ARM_CPUIDLE_WFI_STATE
,
39 .target_residency
= 75,
40 .enter
= imx7ulp_enter_wait
,
47 .target_residency
= 150,
48 .enter
= imx7ulp_enter_wait
,
54 .safe_state_index
= 0,
57 int __init
imx7ulp_cpuidle_init(void)
59 return cpuidle_register(&imx7ulp_cpuidle_driver
, NULL
);