2 * Copyright (C) 2014 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/cpuidle.h>
10 #include <linux/module.h>
11 #include <asm/cpuidle.h>
17 static int imx6sl_enter_wait(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int index)
20 imx6_set_lpm(WAIT_UNCLOCKED);
22 * Software workaround for ERR005311, see function
23 * description for details.
26 imx6sl_set_wait_clk(true);
29 imx6sl_set_wait_clk(false);
30 imx6_set_lpm(WAIT_CLOCKED);
35 static struct cpuidle_driver imx6sl_cpuidle_driver = {
36 .name = "imx6sl_cpuidle",
40 ARM_CPUIDLE_WFI_STATE,
44 .target_residency = 75,
45 .flags = CPUIDLE_FLAG_TIMER_STOP,
46 .enter = imx6sl_enter_wait,
52 .safe_state_index = 0,
55 int __init imx6sl_cpuidle_init(void)
57 return cpuidle_register(&imx6sl_cpuidle_driver, NULL);