1:添加头文件
#include <linux/proc_fs.h>
#include <linux/fs.h>
2:定义的变量
#if H500_TP_PS_MODIFY
int sound8976_galley_select_flag = 0;
#define MODEM_SWITCH_PROC_NAME "ps_value"
#define PROC_NAME "ps"
static struct proc_dir_entry * s_proc = NULL;
//extern struct proc_dir_entry proc_root;
struct proc_dir_entry *root_entry =NULL;
struct proc_dir_entry *entry = NULL;
int psvalue = 0;
#endif
3:读写函数
#if H500_TP_PS_MODIFY
static int modem_switch_writeproc(struct file *file,const char *buffer,
unsigned long count, void *data)
{
int value;
sscanf(buffer, "%d", &psvalue);
printk("************************luu value ==value %d***********************\n",psvalue);
return count;
}
static int mode