I didn't see a LED I added in /sys/class/leds/

I am trying to control the LED via GPIO15/AP2MDM_READY gpio and see that GPIO is GPIO3_PBB.00 using Jetson-TX2-Generic-Customer-Pinmux-Template.xlsm.
I added the following code to kernel_source/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dts:
leds {
compatible = “gpio-leds”;
led@0 {
label = “green_led”;
gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(BB, 0) 1>;
linux, default-trigger = “default-on”;
default-state = “on”;
      In the linux system /sys/class/leds/ directory I only see mmc0 :: mmc1 :: mmc2 ::, but did not see the green_led I added.
      May I ask what is the lack of step?
The software version I use is Jetson 3.0 (kernel 4.4.15) TX2

Does set GPIO pin BB0 to high/low can on/off the LED?

I configured the LED device tree as above, and it didn’t generate the green_led directory in /sys/class/leds/ ?

How can I set GPIO pin BB0 to high/low?


Please try to use following command

echo <# of pin BB0> > /sys/class/gpio/export 
echo out > /sys/class/gpio/gpio<your #>/direction 
echo 1 > /sys/class/gpio/gpio<your #>/value

The accepted answer does not answer original question. I too am adding a “gpio-leds” node to my device tree for Jetson TX1 and cannot get my LED to appear in /sys/class/leds. My node looks like this:

leds {
    status = "okay";
    compatible = "gpio-leds";
    led_top_0@0 {
        linux,default-trigger = "none";
        label = "led_top_0";
        default-state = "off";
        gpios = <&gpio 219 GPIO_ACTIVE_HIGH>; // gpio_x1_aud_pbb3

Please advise how Linux for Tegra handles these nodes.

I don’t think we have this node in driver on tx2 anymore… May I ask why do you know you can add it to device tree?

I thought I would revisit this post (2yrs later) because your response is confusing. Why would I not be able to add this node? This is a fairly straightforward and common implementation of a kernel-controllable GPIO LED. Were you indicating that GPIO-LED was removed from linux-tegra’s defconfig?

Yes, I was not sure whether leds driver is in use on TX2 or not. But it should be enabled on latest r32.x release.

Perhaps a comment on the topic would help, although it is not a direct answer.

The device tree is read by drivers which have an interest in particular device tree nodes. Anything in the device tree is basically passed to the kernel as an argument, and various parts of the kernel (including modules or other drivers) are free to use or ignore that information.

The files in “/dev/” are not real files, but are a direct result of a driver in the kernel implementing that file as it runs. If the driver does not run, then there will be no such file.

If the arguments passed to the driver are not valid for creating that file, then the file will not exist.

If the driver does not exist, then the file will not exist (even if the device tree arguments are otherwise valid since there would be nothing there to read the tree).

It isn’t unusual for newer releases of a driver to require a new syntax or naming within a tree. Incorrect syntax will probably be the same result as a missing device tree.