#include <soc/samsung/ect_parser.h>
#include "samsung/exynos_tmu.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
-
/**
* struct power_table - frequency to power conversion
* @frequency: frequency in KHz
return 0;
}
-static int build_static_power_table(struct gpufreq_cooling_device *gpufreq_cdev)
+static int build_static_power_table(struct device_node *np, struct gpufreq_cooling_device *gpufreq_cdev)
{
int i, j;
- int ratio = cal_asv_get_ids_info(ACPM_DVFS_G3D);
- int asv_group = cal_asv_get_grp(ACPM_DVFS_G3D);
+ int ratio = 0, asv_group = 0, cal_id = 0, ret = 0;
void *gen_block;
struct ect_gen_param_table *volt_temp_param, *asv_param;
int ratio_table[16] = { 0, 25, 29, 35, 41, 48, 57, 67, 79, 94, 110, 130, 151, 162, 162, 162};
+ ret = of_property_read_u32(np, "g3d_cmu_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;
if (ret)
return ERR_PTR(ret);
- ret = build_static_power_table(gpufreq_cdev);
+ ret = build_static_power_table(np, gpufreq_cdev);
if (ret)
return ERR_PTR(ret);
}
#define EXYNOS_TMU_LPI_MODE_SHIFT (10)
#define EXYNOS_TMU_LPI_MODE_MASK (1)
+#define EXYNOS_GPU_THERMAL_ZONE_ID (2)
+
#define TOTAL_SENSORS 16
#define DEFAULT_BALANCE_OFFSET 20
data->tzd->ops->set_mode(data->tzd, THERMAL_DEVICE_ENABLED);
#ifdef CONFIG_MALI_DEBUG_KERNEL_SYSFS
- if (data->id == 2)
+ if (data->id == EXYNOS_GPU_THERMAL_ZONE_ID)
gpu_thermal_data = data;
#endif
char buf[48];
ssize_t ret;
- exynos_acpm_tmu_ipc_dump(2, data.dump);
+ exynos_acpm_tmu_ipc_dump(EXYNOS_GPU_THERMAL_ZONE_ID, data.dump);
ret = snprintf(buf, sizeof(buf), "%3d %3d %3d %3d %3d %3d %3d\n",
data.val[1], data.val[2], data.val[3],