摘要:
1.声明input_dev结构体 static struct input_dev *buttons_dev;2.init函数中分配input_dev结构体并对其设置、注册/* 1. 分配一个input_dev结构体 */ buttons_dev = input_allocate_device... 阅读全文
摘要:
1.首先构造file_operations结构体,并写出相关函数static struct file_operations first_drv_fops = {.owner = THIS_MODULE, /* 这是一个宏,推向编译模块时自动创建的__this_module变量 */.open = ... 阅读全文