Commit | Line | Data |
---|---|---|
0af4817b MD |
1 | /* |
2 | * CPUIdle support code for SH-Mobile ARM | |
3 | * | |
4 | * Copyright (C) 2011 Magnus Damm | |
5 | * | |
6 | * This file is subject to the terms and conditions of the GNU General Public | |
7 | * License. See the file "COPYING" in the main directory of this archive | |
8 | * for more details. | |
9 | */ | |
10 | ||
11 | #include <linux/pm.h> | |
12 | #include <linux/cpuidle.h> | |
13 | #include <linux/suspend.h> | |
14 | #include <linux/module.h> | |
15 | #include <linux/err.h> | |
ee807dd8 | 16 | #include <asm/cpuidle.h> |
0af4817b MD |
17 | #include <asm/io.h> |
18 | ||
5b41147c | 19 | static struct cpuidle_driver shmobile_cpuidle_default_driver = { |
ee807dd8 RL |
20 | .name = "shmobile_cpuidle", |
21 | .owner = THIS_MODULE, | |
ee807dd8 RL |
22 | .states[0] = ARM_CPUIDLE_WFI_STATE, |
23 | .safe_state_index = 0, /* C1 */ | |
24 | .state_count = 1, | |
0af4817b MD |
25 | }; |
26 | ||
5b41147c RW |
27 | static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver; |
28 | ||
d5047097 | 29 | void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) |
5b41147c RW |
30 | { |
31 | cpuidle_drv = drv; | |
32 | } | |
0af4817b | 33 | |
d5047097 | 34 | int __init shmobile_cpuidle_init(void) |
0af4817b | 35 | { |
3cf4bc36 | 36 | return cpuidle_register(cpuidle_drv, NULL); |
0af4817b | 37 | } |