1
0
mirror of https://github.com/physwizz/a155-U-u1.git synced 2025-08-04 15:30:24 +00:00
Files
a155-U-u1/kernel-5.10/drivers/misc/mediatek/sched/eas/sched_sys_common.c
physwizz 99537be4e2 first
2024-03-11 06:53:12 +11:00

75 lines
1.4 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2021 MediaTek Inc.
*/
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/cpumask.h>
#include <linux/seq_file.h>
#include <linux/energy_model.h>
#include <linux/topology.h>
#include <trace/hooks/topology.h>
#include <trace/events/sched.h>
#include <trace/hooks/sched.h>
#include <linux/cpu.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <sched/sched.h>
#include "sched_sys_common.h"
#define CREATE_TRACE_POINTS
static struct attribute *sched_ctl_attrs[] = {
#if IS_ENABLED(CONFIG_MTK_CORE_PAUSE)
&sched_core_pause_info_attr.attr,
#endif
NULL,
};
static struct attribute_group sched_ctl_attr_group = {
.attrs = sched_ctl_attrs,
};
static struct kobject *kobj;
int init_sched_common_sysfs(void)
{
int ret = 0;
kobj = kobject_create_and_add("sched_ctl",
&cpu_subsys.dev_root->kobj);
if (!kobj) {
pr_info("sched_ctl folder create failed\n");
return -ENOMEM;
}
ret = sysfs_create_group(kobj, &sched_ctl_attr_group);
if (ret)
goto error;
kobject_uevent(kobj, KOBJ_ADD);
#if IS_ENABLED(CONFIG_MTK_SCHED_BIG_TASK_ROTATE)
task_rotate_init();
#endif
return 0;
error:
kobject_put(kobj);
kobj = NULL;
return ret;
}
void cleanup_sched_common_sysfs(void)
{
if (kobj) {
sysfs_remove_group(kobj, &sched_ctl_attr_group);
kobject_put(kobj);
kobj = NULL;
}
}