Weitere ähnliche Inhalte
Ähnlich wie Linux Input device에 대한 료해(Odroid-S Kernel) (20)
Kürzlich hochgeladen (20)
Linux Input device에 대한 료해(Odroid-S Kernel)
- 1. 1. AndroidOS 에서 Event Handler Device Driver 와의 련결(HAL)
- WindowManagerService:
/frameworks/base/services/java/com/android/server/WindowManagerService.java
- mThread: InputDeviceRead :
/frameworks/base/services/java/com/android/server/KeyInputQueue.java
JNI 를통하여
staticJNINativeMethodgInputMethods[] ={
{ "readEvent", "(Landroid/view/RawInputEvent;)Z",
(void*) android_server_KeyInputQueue_readEvent},
- 2. ………………… };
EventHub: /frameworks/base/libs/ui/Eventhub.cpp
bool EventHub::getEvent(int32_t*outDeviceId,int32_t*outType,
int32_t* outScancode,int32_t* outKeycode,uint32_t*outFlags,
int32_t* outValue,nsecs_t*outWhen)
{
…………………
mError = openPlatformInput()?NO_ERROR: UNKNOWN_ERROR; //장치파일열기
………………………..
while(1)
{
…………………………………
res= read(mFDs[i].fd,&iev,sizeof(iev)); 장치파일읽기
………………………………….
}
}
2. Input Device Driver 에 대한 료해(Ordroid –S Kernel)
- 3. 1) driversinputinput.c: Input Driver
includelinuxinput.h 에structinput_dev 로표현된다.
input_init 함수에서문자장치드라이버”input”에 file_operationsinput_fops 를등록한다.
intinput_open_device(structinput_handle *handle)
input_handler 로부터호출되는함수로써주어진입력장치로부터event 을
받기시작하려고할때리용한다.
voidinput_close_device(structinput_handle *handle)
intinput_register_device(structinput_dev*dev)
Inputdevice(실제디바이스)를등록하고 input_dev_list 에추가하며 input_handler 와
련결한다.
voidinput_unregister_device(structinput_dev*dev)
intinput_register_handler(structinput_handler*handler)
- 4. input_handler 를등록하고 input_table[minor]와 input_handler_list 에추가하고input
device 와련결한다.
voidinput_unregister_handler(structinput_handler*handler)
intinput_register_handle(structinput_handle*handle)
input_handle 은device 와handler 를묶어놓은것이다.
voidinput_unregister_handle(structinput_handle *handle)
staticint input_open_file(structinode*inode,structfile *file)
input_table 로부터handler 를얻어hanlder->fops->open 을호출한다.
2) driversinputevdev.c: eventdevice driver(evdev,evdev_handler)
evdev_init(void)함수에서 input_register_handler 함수를호출하여
evdev_open_device 함수에서 input_open_device 함수를호출하여실지장치를구동한다.
3) driverscharkeyboard.c : keyboard device driver(kbd,kbd_handler)
4) driversinputkeyboardodroids_keypad.c: keypad inputdevice driver
hkc1xx_keypad_init 함수에서platform_device_register, platform_driver_unregister 를
호출한다.
probe 함수(hkc1xx_keypad_probe)에서 input_register_device 를호출한다.
5) driversinputtouchscreenodroids_touch.c: touchscreeninputdevice driver
6) driversinputmiscbma150.c, yas529.c, orientation.c: sensorinput device driver