From ab5d89d5f8029d5998e60fad222ef09efcd49fb9 Mon Sep 17 00:00:00 2001 From: Youngtae Lee Date: Mon, 16 Apr 2018 18:19:38 +0900 Subject: [PATCH] samsung: emc: Add help function to finding boost freq If a cpu has boost frequency, emc_get_boost_freq offers boost frequency Change-Id: I101f923dc2d29ef748ff1661b6f8cbb4054f812b Signed-off-by: Youngtae Lee --- drivers/soc/samsung/exynos-emc.c | 13 +++++++++++++ include/soc/samsung/exynos-emc.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/soc/samsung/exynos-emc.c b/drivers/soc/samsung/exynos-emc.c index 513233c04e94..31839b53f927 100644 --- a/drivers/soc/samsung/exynos-emc.c +++ b/drivers/soc/samsung/exynos-emc.c @@ -212,6 +212,19 @@ check_real_freq: return 1; } +/* + * return highest boost frequency + */ +int emc_get_boost_freq(int cpu) +{ + struct emc_domain *domain = emc_get_boost_domain(); + + if (!cpumask_test_cpu(cpu, &domain->cpus)) + return 0; + + return list_last_entry(&emc.modes, struct emc_mode, list)->max_freq; +} + /**********************************************************************************/ /* Update Load */ /**********************************************************************************/ diff --git a/include/soc/samsung/exynos-emc.h b/include/soc/samsung/exynos-emc.h index 1be094df7441..7dcf0fb3126b 100644 --- a/include/soc/samsung/exynos-emc.h +++ b/include/soc/samsung/exynos-emc.h @@ -15,9 +15,11 @@ #ifdef CONFIG_EXYNOS_MODE_CHANGER void exynos_emc_update(int cpu); int exynos_emc_update_cpu_pwr(unsigned int cpu, bool on); +int emc_get_boost_freq(int cpu); #else static inline void exynos_emc_update(int cpu) {}; static inline int exynos_emc_update_cpu_pwr(unsigned int cpu, bool on) { return 0; }; +static inline int emc_get_boost_freq(int cpu) { return 0; }; #endif #endif /* __EXYNOS_MODE_CHANGER_H */ -- 2.20.1