文件目录:linux\Documentation\devicetree\bindings\gpio\fsl-imx-gpio.txt
。
一、必须属性
-
compatible
:必须为"fsl,< soc >-gpio"
。 -
reg
:设置设备的寄存器的地址和长度。 -
interrupts
:如果是 1 个数字,32 个引脚共享中断端口。如果是 2 个数字,第 1 个数字代表低 16 个引脚共享中断,第 2 个数字代表高 16 个引脚共享中断。 -
gpio-controller
:将设备节点标记为gpio
控制器。 -
#gpio-cells
:必须是 2。
// 第一个字段描述引脚号
// 第二个字段描述引脚极性,具体定义如下
0:高电平
1:低电平
interrupt-controller
:将设备节点标记为中断控制器。#interrupt-cells
:必须是 2。
// 第一个字段描述 GPIO 号
// 第二个字段低 4 bit 定义触发类型,详细描述如下:
1:上升沿触发
2:下降沿触发
4:高电平触发
8:低电平触发
二、示例
gpio0: gpio@73f84000 {
compatible = "fsl,imx51-gpio", "fsl,imx35-gpio";
reg = <0x73f84000 0x4000>;
interrupts = <50 51>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};