If you need urgent consulting help click here

gpio-leds

Vendor: Generic or vendor-independent

Description

This allows you to define a group of LEDs. Each LED in the group is
controlled by a GPIO. Each LED is defined in a child node of the
gpio-leds node.

Here is an example which defines three LEDs in the node /leds:

/ {
     leds {
             compatible = "gpio-leds";
             led_0 {
                     gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
             };
             led_1 {
                     gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
             };
             led_2 {
                     gpios = <&gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
             };
     };
};

Above:

- led_0 is pin 1 on gpio0. The LED is on when the pin is low,
  and off when the pin is high.
- led_1 is pin 2 on gpio0. The LED is on when the pin is high,
  and off when it is low.
- led_2 is pin 15 on gpio1. The LED is on when the pin is low,
  and the pin's internal pull-up resistor should be enabled.

Properties

Top level properties

These property descriptions apply to “gpio-leds” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

(None)

Deprecated properties not inherited from the base binding file.

(None)

Properties inherited from the base binding file, which defines common properties that may be set on many nodes. Not all of these may apply to the “gpio-leds” compatible.

Name

Type

Details

label

string

Human readable string describing the device and used to set the device
name. It can be passed as argument to device_get_binding() to retrieve
the device. If this property is omitted, then the device name is set
from the node full name.

See Important properties for more information.

Child node properties

Name

Type

Details

gpios

phandle-array

This property is required.

label

string

Human readable string describing the LED. It can be used by an
application to identify this LED or to retrieve its number/index
(i.e. child node number) on the parent device.

See Important properties for more information.