#include <linux/exynos-ss.h>
#include <soc/samsung/tmu.h>
#include <soc/samsung/ect_parser.h>
+#include <soc/samsung/exynos-mcinfo.h>
#include <dt-bindings/thermal/thermal_exynos.h>
#include "exynos_tmu.h"
writel(global_avg_con, data->base + EXYNOS_TMU_REG_AVG_CON);
}
+
+#define MCINFO_LOG_THRESHOLD (4)
+
static int exynos_get_temp(void *p, int *temp)
{
struct exynos_tmu_data *data = p;
struct thermal_cooling_device *cdev;
+ unsigned int mcinfo_count;
+ unsigned int mcinfo_result[4] = {0, 0, 0, 0};
+ unsigned int mcinfo_logging = 0;
+ unsigned int mcinfo_temp = 0;
+ unsigned int i;
if (!data || !data->tmu_read)
return -EINVAL;
mutex_unlock(&thermal_suspend_lock);
exynos_ss_thermal(data->pdata, *temp / 1000, data->tmu_name, 0);
+
+ if (data->id == 0) {
+ mcinfo_count = get_mcinfo_base_count();
+ get_refresh_rate(mcinfo_result);
+
+ for (i = 0; i < mcinfo_count; i++) {
+ mcinfo_temp |= (mcinfo_result[i] & 0xf) << (8 * i);
+
+ if (mcinfo_result[i] >= MCINFO_LOG_THRESHOLD)
+ mcinfo_logging = 1;
+ }
+
+ if (mcinfo_logging == 1)
+ exynos_ss_thermal(NULL, mcinfo_temp, "MCINFO", 0);
+ }
return 0;
}