全志A133按键板添加

ir触摸按键:

一.此部分为修改kernel内核宏开关

1>.longan\kernel\linux-4.9\arch\arm64\configs\sun50iw10p1smp_a133_android_defconfig

#ir

+CONFIG_IR_SUNXI=y

二.此部分为在设备树中添加board节点

2>.longan\kernel\linux-4.9\arch\arm64\boot\dts\sunxi\sun50iw10p1.dtsi

s_cir0: s_cir@07040000 {

compatible = "allwinner,s_cir";

reg = ;

interrupts = ;

pinctrl-names = "default";

pinctrl-0 = ;

clocks = ,;

status = "okay";

};

ir1: ir@0x05071000 {

compatible = "allwinner,ir_tx";

reg = ;

interrupts = ;

pinctrl-names = "default","sleep";

pinctrl-0 = ,;

clocks = ,;

+/- status = "disabled";

};

三.此部分为添加debug信息头

3>.longan\kernel\linux-4.9\drivers\media\rc\sunxi-ir-dev.c

#include "linux/power/aw_pm.h"

+ #define DEBUG

#define SUNXI_IR_DRIVER_NAME "sunxi-rc-recv"

四.设置默认宏开关管控

4>.longan\kernel\linux-4.9\drivers\media\rc\Kconfig

config IR_RC6_DECODER

tristate "Enable IR raw decoder for the RC6 protocol"

depends on RC_CORE

select BITREVERSE

+/- default n

---help---

Enable this option if you have an infrared remote control which

uses the RC6 protocol, and you need software decoding support.

config IR_JVC_DECODER

tristate "Enable IR raw decoder for the JVC protocol"

depends on RC_CORE

select BITREVERSE

+/ default n

---help---

Enable this option if you have an infrared remote control which

uses the JVC protocol, and you need software decoding support.

config IR_SONY_DECODER

tristate "Enable IR raw decoder for the Sony protocol"

depends on RC_CORE

select BITREVERSE

+/- default n

---help---

Enable this option if you have an infrared remote control which

uses the Sony protocol, and you need software decoding support.

config IR_SANYO_DECODER

tristate "Enable IR raw decoder for the Sanyo protocol"

depends on RC_CORE

+/- default n

---help---

Enable this option if you have an infrared remote control which

uses the Sanyo protocol (Sanyo, Aiwa, Chinon remotes),

and you need software decoding support.

config IR_SHARP_DECODER

tristate "Enable IR raw decoder for the Sharp protocol"

depends on RC_CORE

+/- default n

---help---

Enable this option if you have an infrared remote control which

uses the Sharp protocol (Sharp, Denon), and you need software

decoding support.

config IR_MCE_KBD_DECODER

tristate "Enable IR raw decoder for the MCE keyboard/mouse protocol"

depends on RC_CORE

select BITREVERSE

+/- default n

---help---

Enable this option if you have a Microsoft Remote Keyboard for

Windows Media Center Edition, which you would like to use with

a raw IR receiver in your system.

config IR_XMP_DECODER

tristate "Enable IR raw decoder for the XMP protocol"

depends on RC_CORE

select BITREVERSE

+/- default n

---help---

Enable this option if you have IR with XMP protocol, and

if the IR is decoded in software

endif #RC_DECODERS

上面7个从y更改为n

//使用的是这种!

五.此部分为添加按键值

5>.longan\kernel\linux-4.9\drivers\media\rc\rc-sunxi-keymaps.c

static struct rc_map_table sunxi_nec_scan[] = {

- //{ KEY_ESC, KEY_ESC },

+ { 0xff0004, KEY_VOLUMEUP },

+ { 0xff0005, KEY_VOLUMEDOWN },

};

static struct rc_map_list sunxi_map = {

.map = {

.scan = sunxi_nec_scan,

.size = ARRAY_SIZE(sunxi_nec_scan),

- //#ifdef CONFIG_SUNXI_KEYMAPPING_SUPPORT

- // .mapping = (void *)sunxi_key_mapping,

- //#endif

.rc_type = RC_TYPE_NEC, /* Legacy IR type */

.name = RC_MAP_SUNXI,

}

};

六.在配置文件中将IR所需的映射文件导入到小机端

6>.android\device\softwinner\ceres-c3\ceres_c3.mk

+PRODUCT_COPY_FILES += \

+ device/softwinner/ceres-c3/configs/sunxi-ir.kl:system/usr/keylayout/sunxi-ir.kl

七.新增第六步所需的映射文件(内容为按键定义)

7>.android\device\softwinner\ceres-c3\configs\增加sunxi-ir.kl文件 //带弹黄的2key小板

key 114 VOLUME_DOWN

key 115 VOLUME_UP

八.此驱动主要为ir上报驱动(可根据需求自行设计修改)

8>.添加标志位限制按键发送次数:

longan/kernel/linux-4.9/drivers/media/rc/rc-main.c

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值