gpio_to_irq in device tree

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

gpio_to_irq in device tree

4,910 Views
ieio
Contributor IV

Hi all,

moving to Yocto and in particular to the kernel 3.10.17 I need to adapt a driver that used a gpio as interrupt, in the former kernel 3.0.35, I did:

#define INT_PORT   IMX_GPIO_NR(6, 2)

#define INT_IRQ     gpio_to_irq(INT_PORT)

and the result was INT_IRQ 418

now in DTS I do

interrupt-parent = <&gpio6>;

interrupts = <2 2>;

and the result is irq= 322

What I missing?

Labels (3)
0 Kudos
2 Replies

1,722 Views
fabio_estevam
NXP Employee
NXP Employee

You can refer to an example here:

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/arm/boot/dts/imx51-ba...

pmic: mc13892@0 {
compatible = "fsl,mc13892";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pmic>;
spi-max-frequency = <6000000>;
spi-cs-high;
reg = <0>;
interrupt-parent = <&gpio1>;
interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;


In this example GPIO1_8 is a GPIO that is used as interrupt connected to the MC13892 PMIC.


Hope this helps.

0 Kudos

1,722 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I will try to find out why the difference.

Best Regards,

Alejandro

0 Kudos