Tinkerboard lirc with homebrew gpio receiever

  • I would like to enable Tinkerboard lirc with home brew gpio receiver and I really dont understand the full picture of what needs to be done.

    Can I use the lirc_rpi driver? Or can that driver be modified to work? If so, how would I go about getting that driver enabled in the kernel? Or am I on the wrong track?

    Thanks!

  • Thanks for the tip. I added dtoverlay=gpio-ir to /flash/config.txt as per the documentation

    Unfortunately, I am getting no devices found from ir-keytable

    LibreELEC:~/.config # ir-keytable

    No devices found


    Any help greatly appreciated.

    Thanks again.

  • Tinkerboard / Rockchip doesn't support device tree overlays like RPi. Also there's no config.txt on these devices.

    You'll have to create your own .dtb file, eg by applying the needed changes to the dts/dtsi files in the kernel tree and then compiling your own LibreELEC image or by decompiling/modifying/compiling the existing dtb using the devicetree compiler.

    Sorry, I can't help you there, as I don't have a Tinkerboard and am not really familiar with the RK3288 devices.

    so long,

    Hias

  • I've been getting familiar with the device tree. This is all new to me, by the way. I've found a couple examples for adding ir-receiver to the tree.

    Here's a simple ir_reciever section from linux/Documentation/devicetree/bindings/media/gpio-ir-receiver.txt - Elixir - Bootlin

    Code
    ir: ir-receiver {
    		compatible = "gpio-ir-receiver";
    		gpios = <&gpio0 19 1>;
    		linux,rc-map-name = "rc-rc6-mce";
    	};

    I imagine I could modify this to use pin 18. I do not yet understand the rc-map-name purpose or the full gpios line enough to know if this is the only needed change. I am a bit confused as to why the pin needs to be defined in the device tree. Seems to me that this should be configurable at boot time.

    Here's a sample from libreelec patch for arm64 rockchip found at LibreELEC.tv/linux-0006-dts.patch at rockchip · LibreELEC/LibreELEC.tv · GitHub

    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";
    	};


    This sample has many items that are a mystery to me. But I will play around with this and see what I can learn. Any further info anyone could provide to help me understand all of this and make successful changes for the tinkerboard would be greatly appreciated.

    Thanks!

  • The rc-map-name isn't that important, it defines which keymap the kernel should load (if you leave it out it'll default to rc-rc6-mce). As we'll usually override that via rc-maps.cfg in userspace you can just ignore that.

    In the gpio controller block you setup a pin configuration to configure a pin as GPIO.

    This GPIO configuration is then referenced in the gpio-ir-receiver block via the pinctrl property and activated when the ir-receiver module loads.

    The gpios property in ir-reciever is also important as that will tell the gpio-ir-receiver which gpio to use. It has to match the GPIO referenced in the pinctrl handle.


    so long,

    Hias