Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef __ARCH_ARM_MACH_MSM_CPUIDLE_H |
| 15 | #define __ARCH_ARM_MACH_MSM_CPUIDLE_H |
| 16 | |
| 17 | #include <linux/notifier.h> |
| 18 | #include "pm.h" |
| 19 | |
| 20 | struct msm_cpuidle_state { |
| 21 | unsigned int cpu; |
| 22 | int state_nr; |
| 23 | char *name; |
| 24 | char *desc; |
| 25 | enum msm_pm_sleep_mode mode_nr; |
| 26 | }; |
| 27 | |
| 28 | #ifdef CONFIG_CPU_IDLE |
| 29 | void msm_cpuidle_set_states(struct msm_cpuidle_state *states, |
| 30 | int nr_states, struct msm_pm_platform_data *pm_data); |
| 31 | |
| 32 | int msm_cpuidle_init(void); |
| 33 | #else |
| 34 | static inline void msm_cpuidle_set_states(struct msm_cpuidle_state *states, |
| 35 | int nr_states, struct msm_pm_platform_data *pm_data) {} |
| 36 | |
| 37 | static inline int msm_cpuidle_init(void) |
| 38 | { return -ENOSYS; } |
| 39 | #endif |
| 40 | |
| 41 | #ifdef CONFIG_MSM_SLEEP_STATS |
| 42 | enum { |
| 43 | MSM_CPUIDLE_STATE_ENTER, |
| 44 | MSM_CPUIDLE_STATE_EXIT |
| 45 | }; |
| 46 | |
| 47 | int msm_cpuidle_register_notifier(unsigned int cpu, |
| 48 | struct notifier_block *nb); |
| 49 | int msm_cpuidle_unregister_notifier(unsigned int cpu, |
| 50 | struct notifier_block *nb); |
| 51 | #else |
| 52 | static inline int msm_cpuidle_register_notifier(unsigned int cpu, |
| 53 | struct notifier_block *nb) |
| 54 | { return -ENODEV; } |
| 55 | static inline int msm_cpuidle_unregister_notifier(unsigned int cpu, |
| 56 | struct notifier_block *nb) |
| 57 | { return -ENODEV; } |
| 58 | #endif |
| 59 | |
| 60 | #endif /* __ARCH_ARM_MACH_MSM_CPUIDLE_H */ |