Linux 输入子系统笔记

vmlinz posted @ Mon, 04 Jul 2011 14:47:27 +0800 in Linux with tags linux driver input , 5765 readers

Linux Input System

内核的输入子系统将内核中各种零散的输入驱动整合起来,并给它们提供统一的用户层接口和驱动接口。输入子系统主要由Input Device Driver 和Input Event Driver 以及Input Core三个部分组成。

Input system summary

  • Input Device Driver 负责和具体的输入硬件驱动交互,根据硬件信号生成硬件事件
  • Input Event Driver 负责将硬件事件转换为用户空间可以识别的事件信号,和用户空间交互
  • Input Core 和其他子系统一样,核心模块负责提供公共算法

Input Device driver

Device Driver 和硬件交流,生成硬件事件给Input Core。主要的底层驱动有Serio, USB Hid, Bluetooth Hidp, SPI, ISA/LPC, GPIO等。涵盖了几乎所有的输入硬件。

  • struct input_dev; 输入设备结构体
  • int __must_check input_register_device(struct input_dev *); 注册输入设备
  • void input_unregister_device(struct input_dev *); 注销输入设备
  • void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); 向input core 发送硬件事件

Input Event driver

Event Driver 给用户空间提供了一种与硬件无关的抽象方式来实现和输入硬件的交互。主要的Event Driver 有Evdev 接口,它是一个通用的输入事件驱动。内核中还有其他种类的统一事件驱动。

  • struct input_handler; 输入事件驱动结构体,实现输入事件的处理函数
  • struct input_handle; 将输入事件驱动和输入设备驱动结合起来
  • struct input_event; 输入事件结构体
  • int __must_check input_register_handler(struct input_handler *); 输入事件驱动注册
  • void input_unregister_handler(struct input_handler *); 输入事件驱动注销

Resources and referrences

AAA said:
Wed, 09 Feb 2022 00:14:10 +0800

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. Crypto Payment Gateway

AAA said:
Fri, 11 Feb 2022 20:41:34 +0800

Best wishes for publishing this kind of beneficial web site. Your web log isn't only useful but it's additionally really creative too. Robinhood alternatives






Excellent blog! I found it while surfing around on Google. Content of this page is unique as well as well researched. Appreciate it. best time to buy cryptocurrency

AAA said:
Sun, 13 Feb 2022 04:49:44 +0800

Exceptional entry! I found it very interesting. I'll check back later to see if more posts are added. Merchant Services Partner Program





I have been reading out many of your articles and i can claim pretty nice stuff. I will make sure to bookmark your blog. Merchant Service Agent Program






I went over this web site and I think you have a lot of great information, saved to web. become a credit card processor

AAA said:
Tue, 15 Feb 2022 15:35:33 +0800

I thought it was going to be some boring old publish, but it really compensated for my time. I will publish a link to this page on my blog. I am confident my visitors will discover that quite useful how to be a payment processor

meidir said:
Sat, 09 Jul 2022 13:09:03 +0800

Nice read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch since I found it for him smile So let me rephrase that: Thank you for lunch! 攝影器材




Oh my goodness! a wonderful write-up dude. Thanks a lot Nonetheless We are experiencing trouble with ur rss . Do not know why Not able to sign up to it. Perhaps there is anybody getting identical rss problem? Anyone who knows kindly respond. Thnkx iphone回收價




What’s Going down i’m new to this, I stumbled upon this I have discovered It positively useful and it has aided me out loads. I’m hoping to give a contribution & help different users like its aided me. Good job. ipad回收價

meidir said:
Wed, 20 Jul 2022 04:47:05 +0800

This really is this type of great resource that you are providing and you give it away for free. I enjoy seeing blog that understand the worth of providing an excellent resource for free. Woking to Heathrow Taxi

Login *

loading captcha image...
(type the code from the image)
or Ctrl+Enter