#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/cpufreq.h>
-#include <linux/pm_qos.h>
#include <linux/debug-snapshot.h>
#include <linux/pm_opp.h>
#include <linux/cpu_cooling.h>
#include <linux/ems.h>
#include <soc/samsung/cal-if.h>
-#include <soc/samsung/exynos-dm.h>
#include <soc/samsung/ect_parser.h>
#include <soc/samsung/exynos-cpuhp.h>
#include <soc/samsung/exynos-cpupm.h>
*/
LIST_HEAD(domains);
+/*
+ * list head of units which have cpufreq policy dependancy
+ */
+LIST_HEAD(ready_list);
+
/*********************************************************************
* HELPER FUNCTION *
*********************************************************************/
return ret;
}
+/*********************************************************************
+ * EXYNOS CPUFREQ DRIVER API *
+ *********************************************************************/
+void exynos_cpufreq_ready_list_add(struct exynos_cpufreq_ready_block *rb)
+{
+ if (!rb)
+ return;
+
+ list_add(&rb->list, &ready_list);
+}
+
/*********************************************************************
* EXYNOS CPUFREQ DRIVER INTERFACE *
*********************************************************************/
static void exynos_cpufreq_ready(struct cpufreq_policy *policy)
{
+ struct exynos_cpufreq_ready_block *ready_block;
+
+ list_for_each_entry(ready_block, &ready_list, list) {
+ if (ready_block->update)
+ ready_block->update(policy);
+ if (ready_block->get_target)
+ ready_block->get_target(policy, exynos_cpufreq_target);
+ }
}
static int exynos_cpufreq_exit(struct cpufreq_policy *policy)
* Exynos ACME(A Cpufreq that Meets Every chipset) driver implementation
*/
+#include <linux/pm_qos.h>
+#include <soc/samsung/exynos-dm.h>
+
struct exynos_cpufreq_dm {
struct list_head list;
struct exynos_dm_constraint c;
};
+typedef int (*target_fn)(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation);
+
+struct exynos_cpufreq_ready_block {
+ struct list_head list;
+
+ /* callback function to update policy-dependant data */
+ int (*update)(struct cpufreq_policy *policy);
+ int (*get_target)(struct cpufreq_policy *policy, target_fn target);
+};
+
struct exynos_cpufreq_domain {
/* list of domain */
struct list_head list;
* two frequencies in nanoseconds
*/
#define TRANSITION_LATENCY 5000000
+
+/*
+ * Exynos CPUFreq API
+ */
+extern void exynos_cpufreq_ready_list_add(struct exynos_cpufreq_ready_block *rb);