From d4c38589cc29385fc950bceeab5ea8a908d2796c Mon Sep 17 00:00:00 2001 From: Choonghoon Park Date: Fri, 15 Jun 2018 17:45:31 +0900 Subject: [PATCH] hafm/hafm-tb: make strong API for setting boost frequency Change-Id: I13845d6da6440bf2f9bceda1167c059219fd043c --- drivers/soc/samsung/exynos-hafm-tb.c | 10 +++++++++- drivers/soc/samsung/exynos-hafm.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/soc/samsung/exynos-hafm-tb.c b/drivers/soc/samsung/exynos-hafm-tb.c index 250d4ec13497..44f9ed8b7e3f 100644 --- a/drivers/soc/samsung/exynos-hafm-tb.c +++ b/drivers/soc/samsung/exynos-hafm-tb.c @@ -354,6 +354,14 @@ int exynos_hiu_get_max_freq(void) return data->clipped_freq; } +unsigned int exynos_pstate_get_boost_freq(int cpu) +{ + if (!cpumask_test_cpu(cpu, &data->cpus)) + return 0; + + return data->boost_max; +} + /****************************************************************/ /* HIU SR1 WRITE HANDLER */ /****************************************************************/ @@ -488,7 +496,6 @@ static int exynos_hiu_update_data(struct cpufreq_policy *policy) if (!cpumask_test_cpu(data->cpu, policy->cpus)) return 0; - data->boost_max = policy->user_policy.max; data->clipped_freq = data->boost_max; hiu_stats_create_table(policy); @@ -663,6 +670,7 @@ static int hiu_dt_parsing(struct device_node *dn) ret |= of_property_read_u32(dn, "operation-mode", &data->operation_mode); ret |= of_property_read_u32(dn, "boot-freq", &data->cur_freq); ret |= of_property_read_u32(dn, "boost-threshold", &data->boost_threshold); + ret |= of_property_read_u32(dn, "boost-max", &data->boost_max); ret |= of_property_read_u32(dn, "sw-pbl", &data->sw_pbl); ret |= of_property_read_string(dn, "sibling-cpus", &buf); if (ret) diff --git a/drivers/soc/samsung/exynos-hafm.c b/drivers/soc/samsung/exynos-hafm.c index f4da688aa077..02401b22f3a2 100644 --- a/drivers/soc/samsung/exynos-hafm.c +++ b/drivers/soc/samsung/exynos-hafm.c @@ -319,6 +319,14 @@ int exynos_hiu_get_max_freq(void) return data->clipped_freq; } +unsigned int exynos_pstate_get_boost_freq(int cpu) +{ + if (!cpumask_test_cpu(cpu, &data->cpus)) + return 0; + + return data->boost_max; +} + /****************************************************************/ /* HIU SR1 WRITE HANDLER */ /****************************************************************/ @@ -367,7 +375,6 @@ static int exynos_hiu_update_data(struct cpufreq_policy *policy) if (!cpumask_test_cpu(data->cpu, policy->cpus)) return 0; - data->boost_max = policy->user_policy.max; data->clipped_freq = data->boost_max; hiu_stats_create_table(policy); @@ -474,6 +481,7 @@ static int hiu_dt_parsing(struct device_node *dn) ret |= of_property_read_u32(dn, "operation-mode", &data->operation_mode); ret |= of_property_read_u32(dn, "boot-freq", &data->cur_freq); ret |= of_property_read_u32(dn, "boost-threshold", &data->boost_threshold); + ret |= of_property_read_u32(dn, "boost-max", &data->boost_max); ret |= of_property_read_u32(dn, "sw-pbl", &data->sw_pbl); ret |= of_property_read_string(dn, "sibling-cpus", &buf); if (ret) -- 2.20.1