MX6ul gpio input interrupt only on falling edge

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MX6ul gpio input interrupt only on falling edge

345 Views
Konstantin_Bagler
Contributor I

Hi,

We use our custom board with iMX6ul. I need to configure GPIO inputs to generate interrupts on falling edge. For some reason interrupt fires both on falling and rising edges.
GPIOs settings in the device tree:

pinctrl_rotstab: rotstab {
    fsl,pins = <
       MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x1080
       MX6UL_PAD_CSI_DATA03__GPIO4_IO24 0x1080
    >;
};

rotary-stability {
    compatible = "gpio-keys";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_rotstab>;

    ccw-2 {
       label = "counterclockwise-2";
       interrupts-extended = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
       linux,code = <KEY_LEFT>;
    };

    cw-2 {
       label = "clockwise-2";
       interrupts-extended = <&gpio4 23 IRQ_TYPE_EDGE_FALLING>;
       linux,code = <KEY_RIGHT>;
    };
};

I also checked GPIO4_ICR2 and GPIO4_EDGE_SEL register values. Everything is set up correctly, ICR register holds values corresponding to falling edge interrupts, EDGE_SEL register is zero. But for some reason interrupt is generated on both rising and fallling edges.

I already saw this https://community.nxp.com/t5/i-MX-Processors/MX6ul-var-dart-dtsi-for-gpio-input-only-on-falling-edge... post with the same problem but there was no solution there.

Thanks in advance

0 Kudos
1 Reply

317 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Konstantin_Bagler,

I hope you are doing well.

Please include the gpios property in the gpio-key device tree node.

Please refer to https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt

This is due to the gpio-key driver only supporting the irq trigger on both edges.

One can refer to the below-mentioned mail chain.
https://patchwork.kernel.org/project/linux-input/patch/1433402712-21399-1-git-send-email-yvo@apm.com...

Thanks & Regards,
Dhruvit Vasavada