arm64: dts: imx8mq-evk: Add remote control
authorRogerio Pimentel da Silva <rpimentel.silva@gmail.com>
Tue, 22 Oct 2019 19:20:34 +0000 (16:20 -0300)
committerShawn Guo <shawnguo@kernel.org>
Mon, 4 Nov 2019 00:52:12 +0000 (08:52 +0800)
Add remote control to i.MX8M EVK device tree.

The rc protocol must be selected by writing to:
/sys/devices/platform/ir-receiver/rc/rc0/protocols

On my tests, I used "nec" rc protocol:
echo nec > protocols

Tested using evetest:
evtest /dev/input/event0

Output log for each key pressed:
Event:
time 1568122608.267845, -------------- SYN_REPORT ------------
Event:
time 1568122610.503835, type 4 (EV_MSC), code 4 (MSC_SCAN), value 440

Signed-off-by: Rogerio Pimentel da Silva <rpimentel.silva@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mq-evk.dts

index 40fa390..c366859 100644 (file)
                regulator-always-on;
        };
 
+       ir-receiver {
+               compatible = "gpio-ir-receiver";
+               gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ir>;
+       };
+
        wm8524: audio-codec {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8524";
                >;
        };
 
+       pinctrl_ir: irgrp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12              0x4f
+               >;
+       };
+
        pinctrl_pcie0: pcie0grp {
                fsl,pins = <
                        MX8MQ_IOMUXC_I2C4_SCL_PCIE1_CLKREQ_B            0x76