AnsweredAssumed Answered

Configure GPIO as interrupt source

Question asked by lategoodbye on Jul 24, 2013
Latest reply on Mar 21, 2014 by Francesco Aru

Hello Freescale Community,

 

i'm using Linux Kernel 3.10 on i.MX28 EVK and have some problems with dts definition.

I want to use MX28_PAD_I2C0_SDA__GPIO_3_25 as an GPIO (direction: input), who generates interrupts if the input value goes from 0 to 1 (rising edge). Finally, the interrupts should trigger an Kernel module and call it's irq handler. I should mention the Kernel module doesn't have support for Device Tree.

 

In my dts file, i have the following entry:

 

gpio_intr: gpio_intr@0 {
                    reg = <0>;
                    fsl,pinmux-ids = <
                        0x3193 /* MX28_PAD_I2C0_SDA__GPIO_3_25 */
                    >;
                    fsl,drive-strength = <0>;
                    fsl,voltage = <1>;
                    fsl,pull-up = <0>;

                };

 

Here are my questions:

 

Is the dts entry above correct?

What needs to be added, that the GPIO generates interrupts?

Where should be the GPIO direction configured (GPIO section of dts file or init function of mach-mxs/mach-mxs.c)?

Where should be the IRQ event (rising edge) configured (mach-mxs.c, dts file or Kernel module)?

 

Thanks in advance.

 

Stefan

Outcomes