阅读背景:

Linux input输入子系统笔记

来源:互联网 

1、input子系统架构

 123.jpg

下面对每层进行分析:

2、核心层input.c

input_init-> register_chrdev(INPUT_MAJOR, "input", &input_fops); static struct file_operations input_fops = {     .owner = THIS_MODULE,     .open = input_open_file, }; static int input_open_file(struct inode *inode, struct file *file) {     ...     struct input_handler *handler = input_table[iminor(inode) >> 5];     struct file_operations *old_fops, *new_fops = NULL;     if (!handler || !(new_fops = fops_get(handler->fops)))     return -ENODEV;     int err;     old_fops = file->f_op;     file->f_op = new_fops;     err = new_fops->open(inode, file);     … } input_init-> r



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: