2 * arch/arm/mach-tegra/cpu-tegra.h
4 * Copyright (c) 2011-2012, NVIDIA Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef __MACH_TEGRA_CPU_TEGRA_H
22 #define __MACH_TEGRA_CPU_TEGRA_H
24 unsigned int tegra_getspeed(unsigned int cpu);
25 int tegra_update_cpu_speed(unsigned long rate);
26 int tegra_cpu_set_speed_cap(unsigned int *speed_cap);
27 unsigned int tegra_count_slow_cpus(unsigned long speed_limit);
28 unsigned int tegra_get_slowest_cpu_n(void);
29 unsigned long tegra_cpu_lowest_speed(void);
30 unsigned long tegra_cpu_highest_speed(void);
32 #ifdef CONFIG_TEGRA_THERMAL_THROTTLE
33 int tegra_throttle_init(struct mutex *cpu_lock);
34 void tegra_throttle_exit(void);
35 bool tegra_is_throttling(void);
36 unsigned int tegra_throttle_governor_speed(unsigned int requested_speed);
37 int tegra_throttle_debug_init(struct dentry *cpu_tegra_debugfs_root);
38 void tegra_throttling_enable(bool enable);
40 static inline int tegra_throttle_init(struct mutex *cpu_lock)
42 static inline void tegra_throttle_exit(void)
44 static inline bool tegra_is_throttling(void)
46 static inline unsigned int tegra_throttle_governor_speed(
47 unsigned int requested_speed)
48 { return requested_speed; }
49 static inline int tegra_throttle_debug_init(
50 struct dentry *cpu_tegra_debugfs_root)
52 static inline void tegra_throttling_enable(bool enable)
54 #endif /* CONFIG_TEGRA_THERMAL_THROTTLE */
56 #if defined(CONFIG_TEGRA_AUTO_HOTPLUG) && !defined(CONFIG_ARCH_TEGRA_2x_SOC)
57 int tegra_auto_hotplug_init(struct mutex *cpu_lock);
58 void tegra_auto_hotplug_exit(void);
59 void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend);
61 static inline int tegra_auto_hotplug_init(struct mutex *cpu_lock)
63 static inline void tegra_auto_hotplug_exit(void)
65 static inline void tegra_auto_hotplug_governor(unsigned int cpu_freq,
70 #ifdef CONFIG_TEGRA_EDP_LIMITS
71 bool tegra_cpu_edp_favor_up(unsigned int n, int mp_overhead);
72 bool tegra_cpu_edp_favor_down(unsigned int n, int mp_overhead);
74 static inline bool tegra_cpu_edp_favor_up(unsigned int n, int mp_overhead)
76 static inline bool tegra_cpu_edp_favor_down(unsigned int n, int mp_overhead)
80 #ifdef CONFIG_CPU_FREQ
81 int tegra_suspended_target(unsigned int target_freq);
83 static inline int tegra_suspended_target(unsigned int target_freq)
87 #endif /* __MACH_TEGRA_CPU_TEGRA_H */