Android platform key driver [based on x210 Development Board]

Source: Internet
Author: User

Key driver source code in the kernel/ARCH/ARM/mach-s5pv210/button-smdkv210.c, the source code is very simple,
Set the registers of the related buttons in the initial_button_probe function, and then enable timed timer scanning. When the timer is interrupted
The s3cbutton_timer_handler function judges the corresponding IO port level to monitor the key.
It is worth noting that when we need to modify the button function, we need to match the buttons on the android layer.
The definition of the array 'Mr _ keycode' and the key configuration table are implemented. The driver definition is as follows:
Static int initi_keycode [max_button_cnt] = {key_power, key_back, key_volumeup, key_volumedown };
Here, four buttons are defined, namely power, return, volume plus, and volume reduction. Corresponds to the definition in device/Samsung/smdkv210/s3c-button.kl, s3c-button.kl
The content is as follows:
Key 116 endcall wake_dropped
Key 103 dpad_up wake_dropped
Key 108 dpad_down wake_dropped
Key 105 dpad_left wake_dropped
Key 106 dpad_right wake_dropped
Key 114 volume_down wake
Key 115 volume_up wake
Key 139 menu wake_dropped
Key 158 back wake_dropped
Note that the content of the s3c-button.kl here should match the value of out/target/product/smdkv210/system/usr/keylayout/Qwerty. KL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.