AnsweredAssumed Answered

Interfacing TCA9539 Interrupt to LS1012A

Question asked by Alexander Jaiboy on Feb 5, 2019
Latest reply on Feb 14, 2019 by Pavel Chubakov

Hi All


I am trying to interface the interrupt from the TCA9539 to FRWY-LS1012A (INT pin on the mickro BUS expander).


INT pin of the micro BUS expander is connected to the 4th pin of the second GPIO bank (i.e. GPIO2[3]).


The DTS entry is -  

gpioexpander@77 {
      compatible = "nxp,pca9539";
      reg = <0x77>;
      vcc-supply = <&reg_3p3v>;
      interrupt-parent = <&gpio1>;
      interrupts = <4 2>;
      interrupt-cells = <2>;
      gpio-cells = <2>;


The below entries in the DTS is meant to setup interupt from the TCA9539 to be interfaced to the 4th pin of the 2nd GPIO bank of LS1012A, with IRQ being triggered on falling edge (IRQ_TYPE_EDGE_FALLING).

      interrupt-parent = <&gpio1>;
      interrupts = <4 2>;


PCA953x driver is enabled in the kernel.


The Kernel Boot up fails with 
[ 0.367933] genirq: Setting trigger mode 8 for irq 29 failed (mpc8xxx_irq_set_type+0x0/0x1a0)
[ 0.376579] pca953x 0-0077: failed to request irq 29
[ 0.381910] pca953x: probe of 0-0077 failed with error -22


During the probe function of the PCA953x driver the irq setup function(pca953x_irq_setup) is called, which triggers at the end mpc8xxx driver irq setup function (mpc8xxx_irq_set_type). In mpc8xxx_irq_set_type the triggering type (driver code variable - flow_type) comes up as "IRQ_TYPE_LEVEL_LOW (8) " (even though the IRQ_TYPE_EDGE_FALLING is set in the DTS).


TCA9539 gpio-expander without the interrupt related entries in the DTS, works fine. I am able to configure the GPIO pins using SYSFS(/sys/class/gpio/).


I am struggling to use TCA9539 gpio expander, with the interupt enabled in the DTS.



Any help is much appreciated.