How to configure the LED in dts file using gpio for imx8mp

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

How to configure the LED in dts file using gpio for imx8mp

1,576 Views
mbm
Contributor I

Hi,

I am using imx8mp processor

Two leds connected to uart4 (Rx and Tx) respectively on gpio5. They are configure in dts file.

After building and uploaded image the led-1 and led-2 are not found in /sys/class/leds folder

It is necessary Leds  should visible in sys/class/leds directory

Led is not working if i put the gpio pin value 0.

Following are the source code for your reference.

 

leds {
compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_led_gpio>;
led-0 { 
gpios = <&gpio5 28 GPIO_ACTIVE_LOW>;
label = "Uart4 Rx-pin28";
default-state = "off";
};
led-1 { 
gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
label = "Uart4 Tx-pin29";
default-state = "off";
};
};
 
pinctrl_led_gpio: ledkey {
fsl,pins = <
MX8MP_IOMUXC_UART4_TXD__GPIO5_IO29 0x146
MX8MP_IOMUXC_UART4_RXD__GPIO5_IO28 0x146
>;
};

 

You are requested to provide some solution on above problem

 

thanks

 

Manoj Makhe

 

 

 

0 Kudos
Reply
1 Reply

1,559 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

I hope you are doing well.

I suggest you use the EVK Device Tree as reference, please check it on the next link.

Having your GPIOs/LEDs set in pinctrl_gpio_led and no other module using pinctrl_gpio_led, it should be accessed from UserSpace.

Best regards.

Jorge.

0 Kudos
Reply