1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014 Freescale Semiconductor, Inc.
6 #include <linux/cpuidle.h>
7 #include <linux/module.h>
8 #include <asm/cpuidle.h>
13 static int imx6sl_enter_wait(struct cpuidle_device
*dev
,
14 struct cpuidle_driver
*drv
, int index
)
16 imx6_set_lpm(WAIT_UNCLOCKED
);
18 * Software workaround for ERR005311, see function
19 * description for details.
21 imx6sl_set_wait_clk(true);
23 imx6sl_set_wait_clk(false);
24 imx6_set_lpm(WAIT_CLOCKED
);
29 static struct cpuidle_driver imx6sl_cpuidle_driver
= {
30 .name
= "imx6sl_cpuidle",
34 ARM_CPUIDLE_WFI_STATE
,
38 .target_residency
= 75,
39 .flags
= CPUIDLE_FLAG_TIMER_STOP
,
40 .enter
= imx6sl_enter_wait
,
46 .safe_state_index
= 0,
49 int __init
imx6sl_cpuidle_init(void)
51 return cpuidle_register(&imx6sl_cpuidle_driver
, NULL
);