static bool cold_comp;
static unsigned int acpm_tmu_ch_num, acpm_tmu_size;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
static bool acpm_tmu_test_mode;
static bool acpm_tmu_log;
} \
} while (0)
-#endif
-
#define acpm_ipc_err_check() \
do { \
if (ret < 0) { \
struct ipc_config config;
union tmu_ipc_message message;
int ret;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
unsigned long long before, after, latency;
-#endif
memset(&message, 0, sizeof(message));
config.response = true;
config.indirection = false;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
before = sched_clock();
-#endif
ret = acpm_ipc_send_data(acpm_tmu_ch_num, &config);
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
after = sched_clock();
latency = after - before;
-#endif
acpm_ipc_err_check();
acpm_ipc_latency_check();
struct ipc_config config;
union tmu_ipc_message message;
int ret;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
unsigned long long before, after, latency;
-#endif
*cur_temp = 0;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
if (acpm_tmu_test_mode)
return -1;
-#endif
memset(&message, 0, sizeof(message));
config.response = true;
config.indirection = false;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
before = sched_clock();
-#endif
ret = acpm_ipc_send_data(acpm_tmu_ch_num, &config);
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
after = sched_clock();
latency = after - before;
-#endif
acpm_ipc_err_check();
acpm_ipc_latency_check();
memcpy(message.data, config.cmd, sizeof(message.data));
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
if (acpm_tmu_log) {
pr_info("[acpm_tmu] data 0:0x%08x 1:0x%08x 2:0x%08x 3:0x%08x\n",
message.data[0],
message.data[2],
message.data[3]);
}
-#endif
cold_comp = message.resp.cold;
*cur_temp = message.resp.temp;
struct ipc_config config;
union tmu_ipc_message message;
int ret;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
unsigned long long before, after, latency;
-#endif
memset(&message, 0, sizeof(message));
config.response = true;
config.indirection = false;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
before = sched_clock();
-#endif
ret = acpm_ipc_send_data(acpm_tmu_ch_num, &config);
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
after = sched_clock();
latency = after - before;
-#endif
acpm_ipc_err_check();
acpm_ipc_latency_check();
memcpy(message.data, config.cmd, sizeof(message.data));
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
if (acpm_tmu_log) {
pr_info("[acpm_tmu] data 0:0x%08x 1:0x%08x 2:0x%08x 3:0x%08x\n",
message.data[0],
message.data[2],
message.data[3]);
}
-#endif
cold_comp = message.resp.cold;
struct ipc_config config;
union tmu_ipc_message message;
int ret;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
unsigned long long before, after, latency;
-#endif
memset(&message, 0, sizeof(message));
config.response = true;
config.indirection = false;
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
before = sched_clock();
-#endif
ret = acpm_ipc_send_data(acpm_tmu_ch_num, &config);
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
after = sched_clock();
latency = after - before;
-#endif
acpm_ipc_err_check();
acpm_ipc_latency_check();
memcpy(&message.data, config.cmd, sizeof(message.data));
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
if (acpm_tmu_log) {
pr_info("[acpm_tmu] data 0:0x%08x 1:0x%08x 2:0x%08x 3:0x%08x\n",
message.data[0],
message.data[2],
message.data[3]);
}
-#endif
return 0;
}
acpm_ipc_latency_check();
memcpy(&message.data, config.cmd, sizeof(message.data));
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
if (acpm_tmu_log) {
pr_info("[acpm_tmu] data 0:0x%08x 1:0x%08x 2:0x%08x 3:0x%08x\n",
message.data[0],
message.data[2],
message.data[3]);
}
-#endif
return 0;
}
rising_threshold &= ~(EXYNOS_TMU_TEMP_MASK << bit_off);
rising_threshold |= threshold_code << bit_off;
writel(rising_threshold, data->base + reg_off);
-#ifdef TMU_DEBUG
- pr_info("[TMU%d:%d:%d] addr 0x%04x bit-shift %d rise 0x%08x code 0x%x temp %d\n",
- data->id, sensor, i, reg_off, bit_off,
- rising_threshold, threshold_code, temp);
-#endif
/* Set 9-bit temperature code for falling threshold levels */
threshold_code = temp_to_code_with_sensorinfo(data, temp_hist, &data->sensor_info[count]);
falling_threshold &= ~(EXYNOS_TMU_TEMP_MASK << bit_off);
falling_threshold |= threshold_code << bit_off;
writel(falling_threshold, data->base + reg_off + 0x10);
-#ifdef TMU_DEBUG
- pr_info("[TMU%d:%d:%d] addr 0x%04x bit-shift %d fall 0x%08x code 0x%x hyst %d\n",
- data->id, sensor, i, reg_off + 0x10, bit_off,
- falling_threshold, threshold_code, temp_hist);
-#endif
-
interrupt_count++;
}
count++;
module_platform_driver(exynos_tmu_driver);
-#ifdef CONFIG_EXYNOS_THERMAL_DEBUG
#ifdef CONFIG_EXYNOS_ACPM_THERMAL
static void exynos_acpm_tmu_test_cp_call(bool mode)
{
#ifdef CONFIG_EXYNOS_ACPM_THERMAL
debugfs_create_file("test_cp_call", 0x200, debugfs_root, NULL, &test_cp_call_ops);
debugfs_create_file("acpm_tmu_log", 0x200, debugfs_root, NULL, &acpm_tmu_log_ops);
- pr_info("Created exynos thermal debugfs\n");
#endif
return 0;
}
arch_initcall(exynos_thermal_create_debugfs);
-#endif
MODULE_DESCRIPTION("EXYNOS TMU Driver");
MODULE_AUTHOR("Donggeun Kim <dg77.kim@samsung.com>");