Files
android/drivers/misc/mediatek/performance/include/mtk_perfmgr_internal.h
T
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

79 lines
2.5 KiB
C

/*
* Copyright (C) 2018 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _MTK_PERFMGR_INTERNAL_H
#define _MTK_PERFMGR_INTERNAL_H
#include "mtk_ppm_api.h"
/* PROCFS */
#define PROC_FOPS_RW(name) \
static int perfmgr_ ## name ## _proc_open(\
struct inode *inode, struct file *file) \
{ \
return single_open(file,\
perfmgr_ ## name ## _proc_show, PDE_DATA(inode));\
} \
static const struct file_operations perfmgr_ ## name ## _proc_fops = { \
.owner = THIS_MODULE, \
.open = perfmgr_ ## name ## _proc_open, \
.read = seq_read, \
.llseek = seq_lseek,\
.release = single_release,\
.write = perfmgr_ ## name ## _proc_write,\
}
#define PROC_FOPS_RO(name) \
static int perfmgr_ ## name ## _proc_open(\
struct inode *inode, struct file *file) \
{ \
return single_open(file,\
perfmgr_ ## name ## _proc_show, PDE_DATA(inode));\
} \
static const struct file_operations perfmgr_ ## name ## _proc_fops = { \
.owner = THIS_MODULE, \
.open = perfmgr_ ## name ## _proc_open, \
.read = seq_read, \
.llseek = seq_lseek,\
.release = single_release, \
}
#define PROC_ENTRY(name) {__stringify(name), &perfmgr_ ## name ## _proc_fops}
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define for_each_perfmgr_clusters(i) \
for (i = 0; i < clstr_num; i++)
#define perfmgr_clusters clstr_num
#define LOG_BUF_SIZE (128)
extern int clstr_num;
extern int powerhal_tid;
extern char *perfmgr_copy_from_user_for_proc(const char __user *buffer,
size_t count);
extern int check_proc_write(int *data, const char *ubuf, size_t cnt);
extern int check_group_proc_write(int *cgroup, int *data,
const char *ubuf, size_t cnt);
extern void perfmgr_trace_count(int val, const char *fmt, ...);
extern void perfmgr_trace_end(void);
extern void perfmgr_trace_begin(char *name, int id, int a, int b);
extern void perfmgr_trace_printk(char *module, char *string);
extern void perfmgr_trace_log(char *module, const char *fmt, ...);
extern int perfmgr_common_userlimit_cpu_freq(unsigned int cluster_num,
struct ppm_limit_data *final_freq);
#endif /* _MTK_PERFMGR_INTERNAL_H */