AnsweredAssumed Answered

How to enable interrupts of EXP_GPIOs from PCA6416 in IMX8M Mini EVK

Question asked by Hao Qian on Mar 18, 2020
Latest reply on Jun 2, 2020 by Khang Le Truong

Hi,

 

I'm working with IMX8M Mini EVK.

I'm trying to handle interrupts from EXP_GPIO, but got -6 when calling gpiod_to_irq().
The node setting of pca6416 in dts is like below:
========================
    pca6416: gpio@20 {
        compatible = "ti,tca6416";
        reg = <0x20>;
        gpio-controller;
        #gpio-cells = <2>;
    };
========================
I added below to use some EXP_GPIOs in my fpga driver:
========================
&ecspi2 {
    status = "okay";

 

    fpga1: fpga_fw@0 {
        reg = <0>;
        compatible = "lattice,fpga_fw";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_expio>;
        spi-max-frequency = <10000000>;
        fpga_resetb-gpio = <&pca6416 10 GPIO_ACTIVE_HIGH>;
        fpga_nconfig-gpio = <&pca6416 11 GPIO_ACTIVE_HIGH>;
        fpga_conf_done-gpio = <&pca6416 12 GPIO_ACTIVE_HIGH>;
        fpga_intb-gpio = <&pca6416 13 GPIO_ACTIVE_HIGH>;
        fpga_nstatus-gpio = <&pca6416 14 GPIO_ACTIVE_HIGH>;
        fpga_init_done-gpio = <&pca6416 15 GPIO_ACTIVE_HIGH>;
    };
};
========================
and use below api in the driver:
========================
devm_gpiod_get()
gpiod_to_irq()    ← it returns -6 error
========================

 

Do I need to add properties of "interrupt-" to use interrupt feature for EXP_GPIOs?
If so, could you please offer an example code?
 

Thank you,

Qian

Outcomes