PINE64
Onboard IR receiver - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: Linux on Rock64 (https://forum.pine64.org/forumdisplay.php?fid=88)
+--- Thread: Onboard IR receiver (/showthread.php?tid=5703)



Onboard IR receiver - plambe - 02-12-2018

Hi!

I'm unable to find any info about how to start using the onboard IR receiver on the Rock64 on linux.

Can you point me to some info on this subject?


RE: Onboard IR receiver - plambe - 02-13-2018

Bump!

I don't need a detailed tutorial, but giving me a GPIO pin to which the IR receiver is connected or where do I put a dt_overlay setting, or something of this sort which gives me a direction would be welcome.


RE: Onboard IR receiver - Kwiboo - 02-13-2018

The device tree node below should enable the IR receiver.

Code:
ir-receiver {
    compatible = "gpio-ir-receiver";
    gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
    linux,rc-map-name = "rc-pine64";
    pinctrl-0 = <&ir_int>;
    pinctrl-names = "default";
    status = "okay";
};
See https://github.com/Kwiboo/linux-rockchip/blob/rockchip-4.4-dts/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts#L108-L115


RE: Onboard IR receiver - plambe - 03-01-2018

Thanks a lot!

I failed multiple times using only the info you gave me and what I gathered from around the internet about device trees. Still, I learned that by using dtc to output the default dtb in dts format and using the latest debian stretch from ayufan (stretch-minimal-rock64-0.6.23-189-arm64.img), there actually is an ir-receiver:

Code:
       ir-receiver {
               compatible = "gpio-ir-receiver";
               pinctrl-0 = <0x8b>;
               pinctrl-names = "default";
               status = "okay";
       };

So my question is - how do I add the missing node properties without using variables? I know hardcoding values is bad style, but I think this would be the easiest approach for me. In other words, how do I manually convert for example:

Code:
<&gpio2 RK_PA2 GPIO_ACTIVE_LOW>

Into a value like:

Code:
<0x8b>

My idea is to do that for all the missing/differing properties:

Code:
   gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
   linux,rc-map-name = "rc-pine64";
   pinctrl-0 = <&ir_int>;

And then to compile the patched dts into dtb and overwrite the current dtb.

I'm lost in the sources in your github, I obviously don't understand enough (or, well, anything) about device trees, etc. so I will once again be very thankful for any help and direction.