根据IR规格书,用户码(头码)为0x807f为例,则新建如下文件,头码字节序要颠倒一下
vendor\aw\homlet\hardware\input\multi_ir\keylayout\customer_ir_7f80.kl
如下,根据IR规格,填写键值映射关系
key 6 BACK
key 4 MENU
key 8 DPAD_CENTER
key 27 DPAD_DOWN
key 5 DPAD_UP
key 1 HOME
key 7 DPAD_LEFT
key 9 DPAD_RIGHT
key 12 VOLUME_UP
key 14 VOLUME_DOWN
key 18 POWER
key 61 TV_INPUT
diff --git a/vendor/aw/homlet/hardware/input/multi_ir/multiir.mk b/vendor/aw/homlet/hardware/input/multi_ir/multiir.mk
index 9e700162ab..5aefa94f73 100644
--- a/vendor/aw/homlet/hardware/input/multi_ir/multiir.mk
+++ b/vendor/aw/homlet/hardware/input/multi_ir/multiir.mk
@@ -13,6 +13,7 @@ BASE_KL_COPY_LIST := virtual-remote.kl \
customer_rc5_ir_04.kl \
BASE_KL_COPY_LIST += customer_ir_9f00.kl \
+ customer_ir_7f80.kl \ ###<--- 添加自己的.kl到这里
customer_ir_dd22.kl \
customer_ir_fb04.kl \
customer_ir_ff00.kl \
(1)board.dts
diff --git a/longan/device/config/chips/h713/configs/tuna_p3/linux-5.4/board.dts b/longan/device/config/chips/h713/configs/tuna_p3/linux-5.4/board.dts
index af9d8b7e2f..38baa35c8f 100755
--- a/longan/device/config/chips/h713/configs/tuna_p3/linux-5.4/board.dts
+++ b/longan/device/config/chips/h713/configs/tuna_p3/linux-5.4/board.dts
@@ -62,7 +62,7 @@
gpio_group = "PL";
gpio_pin = <9>;
gpio_function = <3>;
- count = <14>;
+ count = <15>; #### <-- 1. 增加1个按键的count数
ir_power_key_code0 = <0x40>;
ir_addr_code0 = <0xfe01>;
ir_power_key_code1 = <0x1a>;
@@ -91,6 +91,8 @@
ir_addr_code12 = <0xfb04>;
ir_power_key_code13 = <0x42>;
ir_addr_code13 = <0xbf00>;
+ ir_power_key_code14 = <0x12>; #### <-- 2. 增加客制化的电源按键HW按键值
+ ir_addr_code14 = <0x7f80>; #### <-- 3. 增加客制化IR的用户头码,注意字节序颠倒
};
(2)uboot-board.dts (同理,修改此文件)
diff --git a/longan/device/config/chips/h713/configs/tuna_p3/uboot-board.dts b/longan/device/config/chips/h713/configs/tuna_p3/uboot-board.dts
index d166e3fa05..71adc28d51 100644
--- a/longan/device/config/chips/h713/configs/tuna_p3/uboot-board.dts
+++ b/longan/device/config/chips/h713/configs/tuna_p3/uboot-board.dts
@@ -62,7 +62,7 @@
gpio_group = "PL";
gpio_pin = <9>;
gpio_function = <3>;
- count = <14>;
+ count = <15>;
ir_power_key_code0 = <0x40>;
@@ -73,7 +73,7 @@
ir_power_key_code13 = <0x42>;
ir_addr_code13 = <0xbf00>;
+ ir_power_key_code14 = <0x12>;
+ ir_addr_code14 = <0x7f80>;
};
};
console:/ # getevent
/dev/input/event1: 0004 0004 017f801b
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0004 0004 007f801b
/dev/input/event1: 0000 0000 00000000
console:/ # getevent
add device 1: /dev/input/event4
name: "soc@2900000:gpio_keys"
add device 2: /dev/input/event3
name: "sunxi-ir-uinput"
add device 3: /dev/input/event0
name: "sunxi-gpadc0"
add device 4: /dev/input/event1
name: "sunxi-ir"
add device 5: /dev/input/event2
name: "audiocodec sunxi Audio Jack"
(1)上
/dev/input/event3: 0001 0013 00000001
/dev/input/event1: 0004 0004 017f8005 ###### 数据分解: 01-7f80-05 ,0x05为 UP key
/dev/input/event3: 0000 0000 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0001 0013 00000000
/dev/input/event1: 0004 0004 007f8005
/dev/input/event3: 0000 0000 00000000
/dev/input/event1: 0000 0000 00000000
(2)下
/dev/input/event1: 0004 0004 017f801b ###### 数据分解: 01-7f80-1b ,0x1b为 DOWN key
/dev/input/event3: 0001 0014 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event3: 0001 0014 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
(3)左
/dev/input/event1: 0004 0004 017f8007
/dev/input/event3: 0001 0015 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event1: 0004 0004 007f8007
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0001 0015 00000000
/dev/input/event3: 0000 0000 00000000
(4)右
/dev/input/event1: 0004 0004 017f8009
/dev/input/event3: 0001 0016 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event1: 0004 0004 007f8009
/dev/input/event3: 0001 0016 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
(5)关机
/dev/input/event1: 0004 0004 017f8012
/dev/input/event3: 0001 0074 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
/dev/input/event1: 0004 0004 007f8012
/dev/input/event3: 0001 0074 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event3: 0000 0000 00000000
130|console:/ # dumpsys input
INPUT MANAGER (dumpsys input)
Input Manager State:
Interactive: true
System UI Visibility: 0x8008
Pointer Speed: 0
Pointer Gestures Enabled: true
Show Touches: false
Pointer Capture Enabled: false
Event Hub State:
BuiltInKeyboardId: -2
Devices:
-1: Virtual
Classes: 0x40000023
Path:
Enabled: true
Descriptor: a718a782d34bc767f4689c232d64d527998ea7fd
Location:
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
KeyLayoutFile: /system/usr/keylayout/Generic.kl
KeyCharacterMapFile: /system/usr/keychars/Virtual.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice:
1: sunxi-ir-uinput
Classes: 0x0000002b
Path: /dev/input/event3
Enabled: true
Descriptor: 0a253e777d1b2169367be63d7c9054e7991953a6
Location:
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0019, vendor=0x0000, product=0x0000, version=0x0004
KeyLayoutFile: /vendor/usr/keylayout/sunxi-ir-uinput.kl
KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice:
2: sunxi-ir
Classes: 0x00000001
Path: /dev/input/event1
Enabled: true
Descriptor: 485d69228e24f5e46da1598745890b214130dbc4
Location: sunxi-ir/input0
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0019, vendor=0x0001, product=0x0001, version=0x0100
KeyLayoutFile: /vendor/usr/keylayout/sunxi-ir.kl
KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice:
4: audiocodec sunxi Audio Jack
Classes: 0x00000081
Path: /dev/input/event2
Enabled: true
Descriptor: d6a59aa863179ab43a39346203ca02f7639be982
Location: ALSA
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
KeyLayoutFile: /system/usr/keylayout/Generic.kl
KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice:
5: soc@2900000:gpio_keys
Classes: 0x00000001
Path: /dev/input/event4
Enabled: true
Descriptor: d2c52ff0f656fac4cd7b7a118d575e0109a9fe1c
Location: gpio-keys/input0
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0019, vendor=0x0001, product=0x0001, version=0x0100
KeyLayoutFile: /system/usr/keylayout/Generic.kl
KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice:
Unattached video devices: