samsung: emc: Add help function to finding boost freq
authorYoungtae Lee <yt0729.lee@samsung.com>
Mon, 16 Apr 2018 09:19:38 +0000 (18:19 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:35:55 +0000 (17:35 +0900)
If a cpu has boost frequency, emc_get_boost_freq offers
boost frequency

Change-Id: I101f923dc2d29ef748ff1661b6f8cbb4054f812b
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
drivers/soc/samsung/exynos-emc.c
include/soc/samsung/exynos-emc.h

index 513233c04e94f97cc8b411bfd97d7418fc10c725..31839b53f927ffb45c2fd2deb76d9e8bec02cff2 100644 (file)
@@ -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                                    */
 /**********************************************************************************/
index 1be094df74418a93ac55455188daffbecb51f3a4..7dcf0fb3126b4d621e469bf4e79c77d3703c251b 100644 (file)
 #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 */