基于amlogic 5.1平台介绍增加一个遥控器按键的方法。
一,scancode转linuxcode。
先打开遥控调试。
sys/class/remote/amremote # echo 1 > debug_enable
按下amlogic公版遥控器home按键,有以下打印。
shell@t968_2g32g:/sys/class/remote/amremote #
shell@t968_2g32g:/sys/class/remote/amremote #
[ 349.099713@1] remote: framecode=0xee11fe01
[ 349.099805@1] remote: receive scancode=0x11
[ 349.102343@1] remote: keypressed=0x0
[ 349.105961@1] remote: report key!!
[ 349.186191@1] remote: ir controller busy flag = 1
[ 349.186297@1] remote: remote:wait for repeat
[ 349.219758@1] remote: framecode=0x0
[ 349.296177@1] remote: ir controller busy flag = 0
[ 349.296362@1] remote: remote:keyup!!
从以上打印可以看出这个遥控器的customcode是0xfe01,home按键的scancode是0x11。
因此我们在dts中添加REMOTE_KEY(0x11, KEY_HOME)。
map_1: map_1{