在根下面配置 leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_led>;
led0: cpu {
label = "sys-led1";
gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
default-state = "on";
};
led1: user {
label = "sys-led2";
gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;//GPIO_ACTIVE_LOW
linux,default-trigger = "timer";
default-state = "on";
};
led2: power0 {
label = "xag:power0";
gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
led3: power1 {
label = "xag:power1";
gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
};
在iomuxc添加 pinctrl_led: ledgrp {
fsl,pins = <
MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x17059 /* sys-led1 */
MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x17059 /* sys-led2 */
MX6UL_PAD_UART2_CTS_B__GPIO1_IO22 0x17059 /* POW_Ind1 */
MX6UL_PAD_UART4_TX_DATA__GPIO1_IO28 0x17059 /* POW_Ind0 */
>;
};
把生成的dtb文件放到板子上运行 在/sys/class/leds/下没有生成相应的节点
|