blob: 00c26a6804b02f47d1eb42635d3a95aa040c8ef4 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (C) 2018 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
20extern int tag_reg(struct file_operations *const fops, struct kobject *kobj);
21extern int tag_unreg(void);
22#include "met_drv.h"
23#include "met_tag.h"
24extern struct bltable_t bltab;
25#endif
26
27extern struct metdevice met_stat;
28extern struct metdevice met_cpupmu;
29extern struct metdevice met_cpupmu_v2;
30extern struct metdevice met_cookie;
31extern struct metdevice met_memstat;
32extern struct metdevice met_switch;
33extern struct metdevice met_trace_event;
34extern struct metdevice met_dummy_header;
35extern struct metdevice met_backlight;
36
37/* This variable will decide which method to access the CPU PMU counter */
38/* 0: access registers directly */
39/* others: via Linux perf driver */
40extern unsigned int met_cpu_pmu_method;
41
42extern int met_parse_num(const char *str, unsigned int *value, int len);
43extern void met_set_suspend_notify(int flag);
44
45#define PR_CPU_NOTIFY
46#if defined(PR_CPU_NOTIFY)
47extern int met_cpu_notify;
48#endif
49
50//#undef MET_BOOT_MSG
51#define MET_BOOT_MSG
52#if defined(MET_BOOT_MSG)
53extern char met_boot_msg_tmp[256];
54extern int pr_bootmsg(int str_len, char *str);
55#define PR_BOOTMSG(fmt, args...) { \
56 int str_len = snprintf(met_boot_msg_tmp, sizeof(met_boot_msg_tmp), \
57 fmt, ##args); \
58 pr_bootmsg(str_len, met_boot_msg_tmp); }
59#define PR_BOOTMSG_ONCE(fmt, args...) { \
60 static int once; \
61 if (!once) { \
62 int str_len = snprintf(met_boot_msg_tmp, \
63 sizeof(met_boot_msg_tmp), \
64 fmt, ##args); \
65 pr_bootmsg(str_len, met_boot_msg_tmp); \
66 once = 1; \
67 } }
68#else
69#define pr_bootmsg(str_len, str)
70#define PR_BOOTMSG(fmt, args...)
71#define PR_BOOTMSG_ONCE(fmt, args...)
72#endif
73
74#endif /* __INTERFACE_H__ */