I have a GPIO expander (TI TCA9539) on board connected to a Raspberry Pi. I've written a device tree overlay as follows:
When I add this overlay to /boot/firmware/config.txt, everything works as expected, and I can monitor edges using gpiomon. I also see that in /proc/interrupts I have the following line:
However, if I remove the overlay from /boot/firmware/config.txt and instead try to load the overlay dynamically using the interrupts no longer work. I still see all 16 new GPIO lines appear under "gpiochip2" in gpioinfo, but when I run gpiomon, I receive the following error:I also see that the line is missing from /proc/interrupts.
Is there anyway to retain the interrupt functionality when using a dynamic overlay?
Code:
// Raspberry Pi device tree overlay for TCA9539 GPIO Expander/dts-v1/;/plugin/;/{ compatible = "brcm,bcm2835"; fragment@0 { target = <&i2cbus>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; exp1: gpio-extender@77 { #address-cells = <1>; compatible = "ti,tca9539"; reg = <0x74>; interrupt-parent = <&gpio>; /* Use Pi GPIO as interrupt parent */ interrupts = <25 2>; /* Use GPIO25 as interrupt pin, 2=IRQ_TYPE_EDGE_FALLING */ interrupt-names = "gpio-expander"; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; }; }; }; frag100: fragment@100 { target = <&i2c_arm>; i2cbus: __overlay__ { status = "okay"; }; };};
Code:
40: 0 0 0 0 pinctrl-bcm2835 25 Edge 1-0074
Code:
sudo dtoverlay tca9539
Code:
gpiomon: error waiting for events: No such device
Is there anyway to retain the interrupt functionality when using a dynamic overlay?
Statistics: Posted by mattmunee — Tue Aug 13, 2024 6:57 pm