nordic,npm10xx-led

Description

Nordic nPM10 Series PMIC's LED driver

Nordic's nPM10 Series PMICs feature an LED driver whose outputs are multiplexed with GPIOs.
GPIO number to use for each LED child node is specified by its "index" property, therefore it is
required. Using GPIO interface on a GPIO configured as LED will lead to undefined behaviour and
must be avoided.

Every LED can be controlled either by the host SoC or automatically. When an automatic mode is
used, the SW is allowed to control only the brightness of this LED (except for the "error" mode).

HW limitation: the on/off delays passed to the API function `led_blink` are shared between all
LED instances, i.e. blinking different LEDs with different delays is not supported.

Examples

npm1012: pmic@6a {
  /* ... */

  leds {
    compatible = "nordic,npm10xx-led";
    pwm-freq-hz = <488>;

    charge_indicator: led0 {
      index = <1>;
      label = "Charge indication LED on GPIO1";
      led-mode = "charge";
    };

    user_led: led1 {
      index = <0>;
      label = "Red LED on GPIO0";
      drive-current-ma = <10>;
    };
  };

  /* ... */
};

Properties

Top level properties

These property descriptions apply to “nordic,npm10xx-led” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

Name

Type

Details

pwm-freq-hz

int

PWM frequency in Hz.

Default value: 977

Legal values: 122, 244, 488, 977

phase-shift-enable

boolean

Enable phase shifting to minimize peak load currents. Useful when multiple LEDs are used at
once, for example in RGB setting.

blink-mode

string

Perform a single or a double blink, or blink forever on blink tasks.

Default value: forever

Legal values: single, double, forever

Child node properties

Name

Type

Details

index

int

Index of the LED on a controller. It can be used by drivers or
applications to map a logical LED to its real position on the
controller. For example, this allows to handle boards where the
LEDs in an array/strip are not wired following the LED order of
the controller.

This property is required.

Legal values: 0, 1, 2

led-mode

string

LED operation mode. Available options are as follows:
  host: LED is controlled through LED device driver APIs, on/off, blink, brightness.
  charge: LED indicates charging. Brightness control available.
  error: LED indicates charging errors. No controls available.
  vbus-good: LED indicates VBUS GOOD status. Brightness control available.

Default value: host

Legal values: host, charge, error, vbus-good

drive-current-ma

int

LED drive strength in mA.

Default value: 5

Legal values: 5, 10

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.

color-mapping

array

Channel to color mapping of a multicolor LED. If a LED supports
several colors, then the color-mapping property can be used to
describe how the hardware channels and the colors are mapped.

For example the channel to color mapping of RGB LEDs would be

   color-mapping =
        <LED_COLOR_ID_RED>,
        <LED_COLOR_ID_GREEN>,
        <LED_COLOR_ID_BLUE>;