#include <soc/samsung/cal-if.h>
#include <soc/samsung/ect_parser.h>
-#if defined(CONFIG_SOC_EXYNOS8895) && defined(CONFIG_SOC_EMULATOR8895)
-#include <dt-bindings/clock/emulator8895.h>
-#elif defined(CONFIG_SOC_EXYNOS8895) && !defined(CONFIG_SOC_EMULATOR8895)
-#include <dt-bindings/clock/exynos8895.h>
-#elif defined(CONFIG_SOC_EXYNOS7872)
-#include <dt-bindings/clock/exynos7872.h>
-#elif defined(CONFIG_SOC_EXYNOS9810)
-#include <dt-bindings/clock/exynos9810.h>
-#endif
-
/*
* Cooling state <-> CPUFreq frequency
*
return 0;
}
-static int build_static_power_table(struct cpufreq_cooling_device *cpufreq_cdev)
+static int build_static_power_table(struct device_node *np, struct cpufreq_cooling_device *cpufreq_cdev)
{
int i, j;
-#if defined(CONFIG_SOC_EXYNOS9810)
- int ratio = cal_asv_get_ids_info(ACPM_DVFS_CPUCL1);
- int asv_group = cal_asv_get_grp(ACPM_DVFS_CPUCL1);
-#else
- int ratio = cal_asv_get_ids_info(ACPM_DVFS_CPUCL0);
- int asv_group = cal_asv_get_grp(ACPM_DVFS_CPUCL0);
-#endif
+ int ratio, asv_group, cal_id, ret = 0;
+
void *gen_block;
struct ect_gen_param_table *volt_temp_param, *asv_param;
int ratio_table[16] = { 0, 18, 22, 27, 33, 40, 49, 60, 73, 89, 108, 131, 159, 194, 232, 250};
+ ret = of_property_read_u32(np, "cal-id", &cal_id);
+ if (ret) {
+ pr_err("%s: Failed to get cal-id\n", __func__);
+ return -EINVAL;
+ }
+
+ ratio = cal_asv_get_ids_info(cal_id);
+ asv_group = cal_asv_get_grp(cal_id);
+
if (asv_group < 0 || asv_group > 15)
asv_group = 0;
goto remove_ida;
}
- ret = build_static_power_table(cpufreq_cdev);
+ ret = build_static_power_table(np, cpufreq_cdev);
if (ret) {
cdev = ERR_PTR(ret);
goto remove_ida;