gpio_to_irq in device tree

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

gpio_to_irq in device tree

6,120 次查看
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?

标签 (3)
0 项奖励
回复
2 回复数

2,932 次查看
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 项奖励
回复

2,932 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I will try to find out why the difference.

Best Regards,

Alejandro

0 项奖励
回复