2

I have created a devicetree overlay to add an MRF24J40 transceiver to Raspberry Pi. The interface of the transceiver is SPI and an interrupt request.

After some trouble the device finally appears in dmesg and seems to be working, except I get interrupt timeouts when using it. When a command is completed by the transceiver it raises an interrupt, but they never reach the Linux driver.

Here's my overlay:

/dts-v1/;
/plugin/;

/ {
        compatible = "bcrm,bcm2708";

        fragment@0 {
                target = <&spi0>;
                __overlay__ {
                        status = "okay";

                        mrf24j40@0 {
                                status = "okay";
                                compatible = "mrf24j40";
                                spi-max-frequency = <500000>;
                                reg = <0>; /* Chip Enable on CE0 */
                                interrupts = <3 22>; /* Just guessing */
                                interrupt-parent = <&gpio>;
                        };

                        spidev@0 {
                                status = "disabled";
                        };
                };
        };
};

The MRF24J40 is connected to SPI0 and uses CE0 for chip enable. The interrupt is connected to GPIO 22.

I think the overlay is mostly correct, except for "interrupts" and "interrupt-parent" which are just guesses.

Could anyone explain how to map GPIO to interrupts in devicetree?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.