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 | #ifndef __INTERFACE_H__ |
| 15 | #define __INTERFACE_H__ |
| 16 | |
| 17 | #include <linux/fs.h> |
| 18 | |
| 19 | #ifdef MET_USER_EVENT_SUPPORT |
| 20 | extern int tag_reg(struct file_operations *const fops, struct kobject *kobj); |
| 21 | extern int tag_unreg(void); |
| 22 | #include "met_drv.h" |
| 23 | #include "met_tag.h" |
| 24 | extern struct bltable_t bltab; |
| 25 | #endif |
| 26 | |
| 27 | extern struct metdevice met_stat; |
| 28 | extern struct metdevice met_cpupmu; |
| 29 | extern struct metdevice met_cookie; |
| 30 | extern struct metdevice met_memstat; |
| 31 | extern struct metdevice met_switch; |
| 32 | extern struct metdevice met_trace_event; |
| 33 | extern struct metdevice met_dummy_header; |
| 34 | extern struct metdevice met_backlight; |
| 35 | |
| 36 | /* This variable will decide which method to access the CPU PMU counter */ |
| 37 | /* 0: access registers directly */ |
| 38 | /* others: via Linux perf driver */ |
| 39 | extern unsigned int met_cpu_pmu_method; |
| 40 | |
| 41 | /* |
| 42 | * controls whether re-configuring pmu events after leaving cpu off state |
| 43 | */ |
| 44 | extern unsigned int met_cpu_pm_pmu_reconfig; |
| 45 | |
| 46 | extern int met_parse_num(const char *str, unsigned int *value, int len); |
| 47 | extern void met_set_suspend_notify(int flag); |
| 48 | |
| 49 | #define PR_CPU_NOTIFY |
| 50 | #if defined(PR_CPU_NOTIFY) |
| 51 | extern int met_cpu_notify; |
| 52 | #endif |
| 53 | |
| 54 | //#undef MET_BOOT_MSG |
| 55 | #define MET_BOOT_MSG |
| 56 | #if defined(MET_BOOT_MSG) |
| 57 | extern char met_boot_msg_tmp[256]; |
| 58 | extern int pr_bootmsg(int str_len, char *str); |
| 59 | #define PR_BOOTMSG(fmt, args...) { \ |
| 60 | int str_len = snprintf(met_boot_msg_tmp, sizeof(met_boot_msg_tmp), \ |
| 61 | fmt, ##args); \ |
| 62 | pr_bootmsg(str_len, met_boot_msg_tmp); } |
| 63 | #define PR_BOOTMSG_ONCE(fmt, args...) { \ |
| 64 | static int once; \ |
| 65 | if (!once) { \ |
| 66 | int str_len = snprintf(met_boot_msg_tmp, \ |
| 67 | sizeof(met_boot_msg_tmp), \ |
| 68 | fmt, ##args); \ |
| 69 | pr_bootmsg(str_len, met_boot_msg_tmp); \ |
| 70 | once = 1; \ |
| 71 | } } |
| 72 | #else |
| 73 | #define pr_bootmsg(str_len, str) |
| 74 | #define PR_BOOTMSG(fmt, args...) |
| 75 | #define PR_BOOTMSG_ONCE(fmt, args...) |
| 76 | #endif |
| 77 | |
| 78 | #endif /* __INTERFACE_H__ */ |