blob: a8457c4eb99a39159e29a63b32bd1f1b686f4b53 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Daniel Lezcano54a46442013-04-23 08:54:45 +00002/*
3 * Copyright (C) 2012 Freescale Semiconductor, Inc.
Daniel Lezcano54a46442013-04-23 08:54:45 +00004 */
5
6#include <linux/cpuidle.h>
7#include <linux/module.h>
8#include <asm/system_misc.h>
Marco Franchi5ea2e8a2017-09-25 15:55:58 -03009#include "cpuidle.h"
Daniel Lezcano54a46442013-04-23 08:54:45 +000010
11static int imx5_cpuidle_enter(struct cpuidle_device *dev,
12 struct cpuidle_driver *drv, int index)
13{
14 arm_pm_idle();
15 return index;
16}
17
18static struct cpuidle_driver imx5_cpuidle_driver = {
19 .name = "imx5_cpuidle",
20 .owner = THIS_MODULE,
21 .states[0] = {
22 .enter = imx5_cpuidle_enter,
23 .exit_latency = 2,
24 .target_residency = 1,
Daniel Lezcano54a46442013-04-23 08:54:45 +000025 .name = "IMX5 SRPG",
26 .desc = "CPU state retained,powered off",
27 },
28 .state_count = 1,
29};
30
31int __init imx5_cpuidle_init(void)
32{
33 return cpuidle_register(&imx5_cpuidle_driver, NULL);
34}