blob: 216cae87a2d9dcd2a5dde09fbcdf8df3c1f80e34 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
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
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_cookie;
30extern struct metdevice met_memstat;
31extern struct metdevice met_switch;
32extern struct metdevice met_trace_event;
33extern struct metdevice met_dummy_header;
34extern 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 */
39extern unsigned int met_cpu_pmu_method;
40
41/*
42 * controls whether re-configuring pmu events after leaving cpu off state
43 */
44extern unsigned int met_cpu_pm_pmu_reconfig;
45
46extern int met_parse_num(const char *str, unsigned int *value, int len);
47extern void met_set_suspend_notify(int flag);
48
49#define PR_CPU_NOTIFY
50#if defined(PR_CPU_NOTIFY)
51extern int met_cpu_notify;
52#endif
53
54//#undef MET_BOOT_MSG
55#define MET_BOOT_MSG
56#if defined(MET_BOOT_MSG)
57extern char met_boot_msg_tmp[256];
58extern 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__ */