GPIO as interrupt

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

GPIO as interrupt

6,848 次查看
chandraevolute
Contributor V

to make gpio as a interrupt what is the exact device tree notation I have to use.

I am using imx6ulevk board and i want to make GPIO3 22 pin as Interrupt.

these two lines are enough ??

interrupt-parent = <&gpio3>;

interrupts = <22 8>;

where to add these lines in dts file??

and one more doubt what is thee difference between  interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH> this line is mentioned in dtsi file  and interrupt-parent = <&gpio5>; interrupts = <0 8> these lines are mentioned in dts file.

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

2,977 次查看
igorpadykov
NXP Employee
NXP Employee

Hi chandra

device tree interrupts are described on p.8 AN5125 Introduction to Device Trees

http://www.nxp.com/files/32bit/doc/app_note/AN5125.pdf

also gpio is decribed in linux/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt

For i.MX6UL usage one can look at "xnur"  in ../drivers/input/imx6ul_tsc.c

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/input/touchscreen/imx6ul_ts...

its irq function adc_irq_fn() is invoked by node:

node &tsc {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_tsc>;

    xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;

in imx6ul-14x14-evk.dts

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx6ul-14x14-evk....

Another usage gpio interrupt in FT5x06 touchscreen driver:

https://community.nxp.com/thread/430812

Based on these examples one can create own driver with gpio interrupt.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,670 次查看
yangao
Contributor III

Hi igor,

Can you reply the question in original post? "these two lines are enough"?

Thanks,

Winston

0 项奖励
回复