rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2019 MediaTek Inc. |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/sched.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/module.h> |
| 17 | #include <linux/random.h> |
| 18 | #include <linux/fs.h> |
| 19 | |
| 20 | #include "met_drv.h" |
| 21 | #include "trace.h" |
| 22 | /* #include "plf_init.h" */ |
| 23 | #include "sspm/ondiemet_sspm.h" |
| 24 | |
| 25 | static void sspm_walltime_start(void) |
| 26 | { |
| 27 | ondiemet_module[ONDIEMET_SSPM] |= ID_WALL_TIME; |
| 28 | } |
| 29 | |
| 30 | static void sspm_walltime_stop(void) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | static const char sspm_walltime_header[] = "met-info [000] 0.0: sspm WCLK: freq\n"; |
| 35 | |
| 36 | static int sspm_walltime_print_header(char *buf, int len) |
| 37 | { |
| 38 | return snprintf(buf, PAGE_SIZE, sspm_walltime_header); |
| 39 | } |
| 40 | |
| 41 | struct metdevice met_sspm_walltime = { |
| 42 | .name = "sspm_wall_time", |
| 43 | .owner = THIS_MODULE, |
| 44 | .type = MET_TYPE_BUS, |
| 45 | .cpu_related = 0, |
| 46 | .ondiemet_mode = 0, |
| 47 | .print_header = sspm_walltime_print_header, |
| 48 | .ondiemet_start = sspm_walltime_start, |
| 49 | .ondiemet_stop = sspm_walltime_stop, |
| 50 | .ondiemet_print_header = sspm_walltime_print_header, |
| 51 | }; |
| 52 | EXPORT_SYMBOL(met_sspm_walltime); |