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