/* drivers/samsung/pm/sec_pm_cpufreq.c * * Copyright (c) 2020 Samsung Electronics Co., Ltd. * Author: Minsung Kim * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _LINUX_SEC_PM_CPUFREQ_H #define _LINUX_SEC_PM_CPUFREQ_H #include struct sec_pm_cpufreq_dev { unsigned int id; unsigned int max_freq; unsigned int min_freq; struct cpufreq_frequency_table *freq_table; unsigned int max_level; unsigned int cur_level; struct cpufreq_policy *policy; struct list_head node; }; #ifdef CONFIG_SEC_PM_CPUFREQ struct sec_pm_cpufreq_dev * sec_pm_cpufreq_register(struct cpufreq_policy *policy); void sec_pm_cpufreq_unregister(struct sec_pm_cpufreq_dev *cdev); int sec_pm_cpufreq_throttle_by_one_step(void); void sec_pm_cpufreq_unthrottle(void); #else static inline struct sec_pm_cpufreq_dev * sec_pm_cpufreq_register(struct cpufreq_policy *policy) { return ERR_PTR(-ENOSYS); } static inline void sec_pm_cpufreq_unregister(struct sec_pm_cpufreq_dev *cdev) { return; } static inline int sec_pm_cpufreq_throttle_by_one_step(void) { return 0; } static inline void sec_pm_cpufreq_unthrottle(void) { } #endif /* CONFIG_SEC_PM_FREQ */ #endif /* _LINUX_SEC_PM_CPUFREQ_H */