Skip to content

Commit 5ad9570

Browse files
yc-hou-0919scorpiochang
authored andcommitted
Add remote controller with lirc
Change-Id: Icf402a975265ca117940e887b1431ec428295b54 Reviewed-on: https://tp-biosrd-v02/gerrit/81362 Reviewed-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com> Tested-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com>
1 parent 86b2255 commit 5ad9570

7 files changed

Lines changed: 874 additions & 4 deletions

File tree

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
1111
w1-gpio.dtbo \
1212
pitft35-resistive-tinker.dtbo \
1313
ds1307.dtbo \
14+
lirc-rpi.dtbo \
1415

1516
targets += dtbs dtbs_install
1617
targets += $(dtbo-y)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Definitions for lirc-rpi module
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/ {
6+
compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
7+
8+
fragment@0 {
9+
target-path = "/";
10+
__overlay__ {
11+
lirc_rpi: lirc_rpi {
12+
compatible = "rpi,lirc-rpi";
13+
pinctrl-names = "default";
14+
pinctrl-0 = <&lirc_pins>;
15+
status = "okay";
16+
17+
// Override autodetection of IR receiver circuit
18+
// (0 = active high, 1 = active low, -1 = no override )
19+
rpi,sense = <0xffffffff>;
20+
21+
// Software carrier
22+
// (0 = off, 1 = on)
23+
rpi,softcarrier = <1>;
24+
25+
// Invert output
26+
// (0 = off, 1 = on)
27+
rpi,invert = <0>;
28+
29+
// Enable debugging messages
30+
// (0 = off, 1 = on)
31+
rpi,debug = <0>;
32+
};
33+
};
34+
};
35+
36+
fragment@1 {
37+
target = <&gpio5>;
38+
__overlay__ {
39+
lirc_pins: lirc_pins {
40+
rockchip,pins = <5 12 0 &pcfg_pull_none>,
41+
<5 14 1 &pcfg_pull_up>;
42+
};
43+
};
44+
};
45+
};

arch/arm/configs/miniarm-rk3288_defconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,3 +792,16 @@ CONFIG_W1_SLAVE_THERM=y
792792
CONFIG_RK_CHAR_DRIVERS=y
793793
CONFIG_RK3288_DEVGPIOMEM=y
794794
CONFIG_RTC_DRV_DS1307=m
795+
CONFIG_RC_CORE=y
796+
CONFIG_LIRC=y
797+
CONFIG_IR_NEC_DECODER=y
798+
CONFIG_IR_RC5_DECODER=y
799+
CONFIG_IR_RC6_DECODER=y
800+
CONFIG_IR_JVC_DECODER=y
801+
CONFIG_IR_SONY_DECODER=y
802+
CONFIG_IR_SANYO_DECODER=y
803+
CONFIG_IR_SHARP_DECODER=y
804+
CONFIG_IR_MCE_KBD_DECODER=y
805+
CONFIG_IR_LIRC_CODEC=y
806+
CONFIG_IR_XMP_DECODER=y
807+
CONFIG_MEDIA_RC_SUPPORT=y

drivers/media/cec/cec-adap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,10 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
16991699
!(adap->log_addrs.flags & CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU))
17001700
break;
17011701

1702-
#if IS_REACHABLE(CONFIG_RC_CORE)
1702+
/* Disable this since the original setting without define CONFIG_RC_CORE
1703+
* However, if add the define above, it still lacks some part of cec.
1704+
*/
1705+
#if 0 //IS_REACHABLE(CONFIG_RC_CORE)
17031706
switch (msg->msg[2]) {
17041707
/*
17051708
* Play function, this message can have variable length
@@ -1736,7 +1739,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
17361739
if (!(adap->capabilities & CEC_CAP_RC) ||
17371740
!(adap->log_addrs.flags & CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU))
17381741
break;
1739-
#if IS_REACHABLE(CONFIG_RC_CORE)
1742+
#if 0 //IS_REACHABLE(CONFIG_RC_CORE)
17401743
rc_keyup(adap->rc);
17411744
#endif
17421745
break;

drivers/media/cec/cec-core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,12 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
237237
if (!(caps & CEC_CAP_RC))
238238
return adap;
239239

240-
#if IS_REACHABLE(CONFIG_RC_CORE)
240+
/* Disable this since the original setting without define CONFIG_RC_CORE
241+
* However, if add the define above, it still lacks some part of cec.
242+
*/
243+
#if 0 //IS_REACHABLE(CONFIG_RC_CORE) // disable this since the original setting without define CONFIG_RC_CORE
241244
/* Prepare the RC input device */
242-
adap->rc = rc_allocate_device(RC_DRIVER_SCANCODE);
245+
adap->rc = rc_allocate_device();
243246
if (!adap->rc) {
244247
pr_err("cec-%s: failed to allocate memory for rc_dev\n",
245248
name);

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ obj-$(CONFIG_UID_SYS_STATS) += uid_sys_stats.o
6363
obj-$(CONFIG_MEMORY_STATE_TIME) += memory_state_time.o
6464
obj-$(CONFIG_USB_CAM_GPIO) += usb_cam_gpio.o
6565
obj-$(CONFIG_TINKER_MCU) += tinker_mcu.o
66+
obj-m += lirc_rpi.o

0 commit comments

Comments
 (0)