diff options
| author | Mobile Promotions <svcmobile_promotions@nvidia.com> | 2017-11-13 07:06:31 -0500 |
|---|---|---|
| committer | Mobile Promotions <svcmobile_promotions@nvidia.com> | 2017-11-13 07:06:31 -0500 |
| commit | 05cc167f197cef9a34dde58f5d246ad1cdf18c19 (patch) | |
| tree | 2aa3889a9fae3843bdf3d29fb10b960d22718d96 /include/linux | |
| parent | fe1ce0a8537f826fc122a28bf3f4b0a31fdc1f13 (diff) | |
| parent | 308ec2445645714c994cf1e688462868035236e2 (diff) | |
Merge branch 'promotion_rebase' into promotion_build
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/platform/tegra/cpu-tegra.h | 109 | ||||
| -rw-r--r-- | include/linux/platform/tegra/cpu_emc.h | 25 |
2 files changed, 134 insertions, 0 deletions
diff --git a/include/linux/platform/tegra/cpu-tegra.h b/include/linux/platform/tegra/cpu-tegra.h new file mode 100644 index 000000000..4a21ec288 --- /dev/null +++ b/include/linux/platform/tegra/cpu-tegra.h | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | /* | ||
| 2 | * linux/platform/tegra/cpu-tegra.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2011-2017, NVIDIA Corporation. All rights reserved. | ||
| 5 | * | ||
| 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. | ||
| 10 | * | ||
| 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 | ||
| 14 | * more details. | ||
| 15 | * | ||
| 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. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __MACH_TEGRA_CPU_TEGRA_H | ||
| 22 | #define __MACH_TEGRA_CPU_TEGRA_H | ||
| 23 | |||
| 24 | #include <linux/fs.h> | ||
| 25 | #include <linux/tegra_throttle.h> | ||
| 26 | |||
| 27 | unsigned int tegra_getspeed(unsigned int cpu); | ||
| 28 | int tegra_update_cpu_speed(unsigned long rate); | ||
| 29 | int tegra_cpu_set_speed_cap(unsigned int *speed_cap); | ||
| 30 | int tegra_cpu_set_speed_cap_locked(unsigned int *speed_cap); | ||
| 31 | void tegra_cpu_set_volt_cap(unsigned int cap); | ||
| 32 | |||
| 33 | #if defined(CONFIG_TEGRA_CPUQUIET) && defined(CONFIG_TEGRA_CLUSTER_CONTROL) | ||
| 34 | int tegra_auto_hotplug_init(struct mutex *cpulock); | ||
| 35 | void tegra_auto_hotplug_exit(void); | ||
| 36 | void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend); | ||
| 37 | #else | ||
| 38 | static inline int tegra_auto_hotplug_init(struct mutex *cpu_lock) | ||
| 39 | { return 0; } | ||
| 40 | static inline void tegra_auto_hotplug_exit(void) | ||
| 41 | { } | ||
| 42 | static inline void tegra_auto_hotplug_governor(unsigned int cpu_freq, | ||
| 43 | bool suspend) | ||
| 44 | { } | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #ifdef CONFIG_CPU_FREQ | ||
| 48 | struct cpufreq_frequency_table; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * freq_table: List of frequencies allowed for cpu. | ||
| 52 | * throttle_lowest_index: Lowest throttling frequency index. | ||
| 53 | * throttle_highest_index: Highest throttling frequency index. | ||
| 54 | * suspend_index: Suspend frequency index. | ||
| 55 | * preserve_across_suspend: Preserve cpu frequency even after suspend | ||
| 56 | * for restoring during resume. | ||
| 57 | */ | ||
| 58 | struct tegra_cpufreq_table_data { | ||
| 59 | struct cpufreq_frequency_table *freq_table; | ||
| 60 | int throttle_lowest_index; | ||
| 61 | int throttle_highest_index; | ||
| 62 | int suspend_index; | ||
| 63 | bool preserve_across_suspend; | ||
| 64 | }; | ||
| 65 | struct tegra_cpufreq_table_data *tegra_cpufreq_table_get(void); | ||
| 66 | unsigned long tegra_emc_to_cpu_ratio(unsigned long cpu_rate); | ||
| 67 | int tegra_update_mselect_rate(unsigned long cpu_rate); | ||
| 68 | #if defined(CONFIG_ARCH_TEGRA_210_SOC) | ||
| 69 | unsigned long tegra_emc_cpu_limit(unsigned long cpu_rate); | ||
| 70 | #else | ||
| 71 | static inline unsigned long tegra_emc_cpu_limit(unsigned long cpu_rate) | ||
| 72 | { return 0; } | ||
| 73 | #endif | ||
| 74 | int tegra_suspended_target(unsigned int target_freq); | ||
| 75 | #else | ||
| 76 | static inline unsigned long tegra_emc_to_cpu_ratio(unsigned long cpu_rate) | ||
| 77 | { return 0; } | ||
| 78 | static inline int tegra_suspended_target(unsigned int target_freq) | ||
| 79 | { return -ENOSYS; } | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_TEGRA_EDP_LIMITS) | ||
| 83 | int tegra_update_cpu_edp_limits(void); | ||
| 84 | int tegra_cpu_reg_mode_force_normal(bool force); | ||
| 85 | #else | ||
| 86 | static inline int tegra_update_cpu_edp_limits(void) | ||
| 87 | { return 0; } | ||
| 88 | static inline int tegra_cpu_reg_mode_force_normal(bool force) | ||
| 89 | { return 0; } | ||
| 90 | #endif | ||
| 91 | |||
| 92 | #ifdef CONFIG_TEGRA_CPU_VOLT_CAP | ||
| 93 | struct tegra_cooling_device *tegra_vc_get_cdev(void); | ||
| 94 | #else | ||
| 95 | static inline struct tegra_cooling_device *tegra_vc_get_cdev(void) | ||
| 96 | { return NULL; } | ||
| 97 | #endif | ||
| 98 | |||
| 99 | #ifdef CONFIG_TEGRA_HMP_CLUSTER_CONTROL | ||
| 100 | unsigned long lp_to_virtual_gfreq(unsigned long lp_freq); | ||
| 101 | int tegra_cpu_volt_cap_apply(int *cap_idx, int new_idx, int level); | ||
| 102 | #else | ||
| 103 | static inline unsigned long lp_to_virtual_gfreq(unsigned long freq) | ||
| 104 | { return freq; } | ||
| 105 | static inline int tegra_cpu_volt_cap_apply(int *cap_idx, int new_idx, int level) | ||
| 106 | { return -ENOSYS; } | ||
| 107 | #endif | ||
| 108 | |||
| 109 | #endif /* __MACH_TEGRA_CPU_TEGRA_H */ | ||
diff --git a/include/linux/platform/tegra/cpu_emc.h b/include/linux/platform/tegra/cpu_emc.h new file mode 100644 index 000000000..0c21fbeb9 --- /dev/null +++ b/include/linux/platform/tegra/cpu_emc.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef _LINUX_TEGRA_CPU_EMC_H | ||
| 18 | #define _LINUX_TEGRA_CPU_EMC_H | ||
| 19 | |||
| 20 | struct device_node *of_get_scaling_node(const char *name); | ||
| 21 | int enable_cpu_emc_clk(void); | ||
| 22 | void disable_cpu_emc_clk(void); | ||
| 23 | void set_cpu_to_emc_freq(u32 cpu_freq); | ||
| 24 | |||
| 25 | #endif | ||
