drivers: android: Place a no-op PSI driver for SLMK

Signed-off-by: atndko <z1281552865@gmail.com>
Signed-off-by: Jebaitedneko <Jebaitedneko@gmail.com>
Signed-off-by: Panchajanya1999 <rsk52959@gmail.com>
fourteen
atndko 3 years ago committed by Jenna
parent 7d96f7bacb
commit 3c95d20818
  1. 2
      drivers/android/Makefile
  2. 111
      drivers/android/psi.c

@ -3,4 +3,4 @@ ccflags-y += -I$(src) # needed for trace events
obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o
obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
obj-$(CONFIG_ANDROID_SIMPLE_LMK) += simple_lmk.o
obj-$(CONFIG_ANDROID_SIMPLE_LMK) += simple_lmk.o psi.o

@ -0,0 +1,111 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/poll.h>
static bool psi_enable = true;
static int __init setup_psi(char *str)
{
return kstrtobool(str, &psi_enable) == 0;
}
__setup("psi=", setup_psi);
static int psi_io_show(struct seq_file *m, void *v)
{
return 0;
}
static int psi_memory_show(struct seq_file *m, void *v)
{
return 0;
}
static int psi_cpu_show(struct seq_file *m, void *v)
{
return 0;
}
static int psi_io_open(struct inode *inode, struct file *file)
{
return single_open(file, psi_io_show, NULL);
}
static int psi_memory_open(struct inode *inode, struct file *file)
{
return single_open(file, psi_memory_show, NULL);
}
static int psi_cpu_open(struct inode *inode, struct file *file)
{
return single_open(file, psi_cpu_show, NULL);
}
static ssize_t psi_io_write(struct file *file, const char __user *user_buf,
size_t nbytes, loff_t *ppos)
{
return 0;
}
static ssize_t psi_memory_write(struct file *file, const char __user *user_buf,
size_t nbytes, loff_t *ppos)
{
return 0;
}
static ssize_t psi_cpu_write(struct file *file, const char __user *user_buf,
size_t nbytes, loff_t *ppos)
{
return 0;
}
static __poll_t psi_fop_poll(struct file *file, poll_table *wait)
{
return 0;
}
static int psi_fop_release(struct inode *inode, struct file *file)
{
return 0;
}
static const struct file_operations psi_io_fops = {
.open = psi_io_open,
.read = seq_read,
.llseek = seq_lseek,
.write = psi_io_write,
.poll = psi_fop_poll,
.release = psi_fop_release,
};
static const struct file_operations psi_memory_fops = {
.open = psi_memory_open,
.read = seq_read,
.llseek = seq_lseek,
.write = psi_memory_write,
.poll = psi_fop_poll,
.release = psi_fop_release,
};
static const struct file_operations psi_cpu_fops = {
.open = psi_cpu_open,
.read = seq_read,
.llseek = seq_lseek,
.write = psi_cpu_write,
.poll = psi_fop_poll,
.release = psi_fop_release,
};
static int __init psi_proc_init(void)
{
proc_mkdir("pressure", NULL);
proc_create("pressure/io", 0, NULL, &psi_io_fops);
proc_create("pressure/memory", 0, NULL, &psi_memory_fops);
proc_create("pressure/cpu", 0, NULL, &psi_cpu_fops);
return 0;
}
module_init(psi_proc_init);
Loading…
Cancel
Save