hafm/hafm-tb: make strong API for setting boost frequency
authorChoonghoon Park <choong.park@samsung.com>
Fri, 15 Jun 2018 08:45:31 +0000 (17:45 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:39 +0000 (14:59 +0900)
Change-Id: I13845d6da6440bf2f9bceda1167c059219fd043c

drivers/soc/samsung/exynos-hafm-tb.c
drivers/soc/samsung/exynos-hafm.c

index 250d4ec134976dfc5673301910d79473e5ad671a..44f9ed8b7e3f7cf914caecf4bee8d1b9742f5d17 100644 (file)
@@ -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)
index f4da688aa077f759871dd3ebb1bc0b7af082c7ba..02401b22f3a2b3692fd0cb14f3a77ead980f2b83 100644 (file)
@@ -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)