MX6ul-var-dart dtsi for gpio input only on falling edge

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

MX6ul-var-dart dtsi for gpio input only on falling edge

1,062 Views
nirmalpanchal
Contributor II

Hi,

I have started learning device tree for mx6ul and tried to configure the pins as an input or output for EVK board I have with me. It is imx6ul-var6ul-dart EVK board.

I want to configure GPIO pins for the board using device tree with interrupt on falling edge.

I did following :

gpio_keys_in {
        compatible = "gpio-keys";
        #address-cells = <1>;
        #size-cells = <0>;
        autorepeat;

        DI0 {
            label = "GPIO_DI0";
            linux,code = <103>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_dio1>;
            gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;

            /* interrupt properties may be omitted if used gpios property */
            interrupt-parent = <&gpio5>;
            interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
        };
    };

and defined pinctrl_dio1 as

pinctrl_dio1: gpio_keys_di_pins@0 {
            fsl,pins = <
                MX6UL_PAD_SNVS_TAMPER8__GPIO5_IO08    0x80000000    /* DI1 */
            >;
        };

GPIO works as it should , It is working properly as an input pin.

But it triggers interrupt on both rising and falling edges. According to definition as above

interrupts = <8 IRQ_TYPE_EDGE_FALLING>;

It should only trigger interrupt on the falling edge. But for some reason it do on both the edges.

I want gpio input with only falling edge trigger interrupt.

Can somebody tell me what I am doing wrong here ????

2 Replies

805 Views
igorpadykov
NXP Employee
NXP Employee

Hi Nirmal

please check (using jtag or printf) if GPIOx_EDGE_SEL set, refer to

sect.26.5.8 GPIO edge select register (GPIOx_EDGE_SEL) i.MX6UL Reference Manual

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6ULRM.pdf

- Edge select. When GPIO_EDGE_SEL[n] is set, the GPIO

disregards the ICR[n] setting, and detects any edge on the corresponding input signal.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

805 Views
nirmalpanchal
Contributor II

Hi,

igor,

Thank you.

But then how can I configure the GPIO using device tree for falling edge only ?

Or is it not possible ?

0 Kudos