return 0;
}
+int exynos_acpm_tmu_ipc_dump(int no, unsigned int dump[])
+{
+ struct ipc_config config;
+ union tmu_ipc_message message;
+ unsigned long long before, after, latency;
+ int ret;
+
+ memset(&message, 0, sizeof(message));
+
+ message.req.type = TMU_IPC_READ_TEMP;
+ message.req.tzid = no;
+
+ config.cmd = message.data;
+ config.response = true;
+ config.indirection = false;
+
+ before = sched_clock();
+ ret = acpm_ipc_send_data(acpm_tmu_ch_num, &config);
+ after = sched_clock();
+ latency = after - before;
+
+ acpm_ipc_err_check();
+ acpm_ipc_latency_check();
+
+ memcpy(message.data, config.cmd, sizeof(message.data));
+ if (acpm_tmu_log) {
+ pr_info("[acpm_tmu_dump] data 0:0x%08x 1:0x%08x 2:0x%08x 3:0x%08x\n",
+ message.data[0],
+ message.data[1],
+ message.data[2],
+ message.data[3]);
+ }
+
+ dump[0] = message.data[2];
+ dump[1] = message.data[3];
+
+ return 0;
+}
+
static int __init exynos_acpm_tmu_init(void)
{
struct device_node *np;
.write = acpm_tmu_log_write,
.llseek = default_llseek,
};
+
+static ssize_t ipc_dump1_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ union {
+ unsigned int dump[2];
+ unsigned char val[8];
+ } data;
+ char buf[48];
+ ssize_t ret;
+
+ exynos_acpm_tmu_ipc_dump(0, data.dump);
+
+ ret = snprintf(buf, sizeof(buf), "%3d %3d %3d %3d %3d %3d %3d\n",
+ data.val[1], data.val[2], data.val[3],
+ data.val[4], data.val[5], data.val[6], data.val[7]);
+ if (ret < 0)
+ return ret;
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, ret);
+}
+
+static ssize_t ipc_dump2_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ union {
+ unsigned int dump[2];
+ unsigned char val[8];
+ } data;
+ char buf[48];
+ ssize_t ret;
+
+ exynos_acpm_tmu_ipc_dump(2, data.dump);
+
+ ret = snprintf(buf, sizeof(buf), "%3d %3d %3d %3d %3d %3d %3d\n",
+ data.val[1], data.val[2], data.val[3],
+ data.val[4], data.val[5], data.val[6], data.val[7]);
+ if (ret < 0)
+ return ret;
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, ret);
+
+}
+
+static const struct file_operations ipc_dump1_fops = {
+ .open = simple_open,
+ .read = ipc_dump1_read,
+ .llseek = default_llseek,
+};
+
+static const struct file_operations ipc_dump2_fops = {
+ .open = simple_open,
+ .read = ipc_dump2_read,
+ .llseek = default_llseek,
+};
+
#endif
static struct dentry *debugfs_root;
#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);
+ debugfs_create_file("ipc_dump1", 0644, debugfs_root, NULL, &ipc_dump1_fops);
+ debugfs_create_file("ipc_dump2", 0644, debugfs_root, NULL, &ipc_dump2_fops);
#endif
return 0;
}