Documentation / devicetree / bindings / leds / lacie,ns2-leds.yaml


Based on kernel version 7.3. Page generated on 2026-10-19 13:17 EDT.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/lacie,ns2-leds.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Dual-GPIO LEDs found on Network Space v2 (and parents)

maintainers:
  - Simon Guinot <simon.guinot@sequanux.org>

description:
  The Network Space v2 dual-GPIO LED is wired to a CPLD. Three different LED
  modes are available, off, on and SATA activity blinking. The LED modes are
  controlled through two GPIOs (command and slow), each combination of values
  for the command/slow GPIOs corresponds to a LED mode.

properties:
  compatible:
    const: lacie,ns2-leds

additionalProperties:
  type: object
  $ref: common.yaml#
  unevaluatedProperties: false

  description: Each child node represents a single LED

  properties:
    cmd-gpio:
      maxItems: 1
      description: GPIO connected to the command LED output

    slow-gpio:
      maxItems: 1
      description: GPIO connected to the slow LED output

    num-modes:
      $ref: /schemas/types.yaml#/definitions/uint32
      description:
        Number of entries in modes-map.

    modes-map:
      $ref: /schemas/types.yaml#/definitions/uint32-matrix
      description:
        A mapping between LED modes (off, on or SATA activity blinking) and
        the corresponding cmd-gpio/slow-gpio values. All the GPIO values
        combinations should be given in order to avoid having an unknown
        mode at driver probe time.

      items:
        items:
          - description: LED mode
            enum: [0, 1, 2]
          - description: Command GPIO level
            enum: [0, 1]
          - description: Slow GPIO level
            enum: [0, 1]

  required:
    - cmd-gpio
    - slow-gpio
    - modes-map

required:
  - compatible

examples:
  - |
    #include <dt-bindings/leds/leds-ns2.h>
 
    led-controller {
        compatible = "lacie,ns2-leds";
 
        led-0 {
            label = "ns2:blue:sata";
            slow-gpio = <&gpio0 29 0>;
            cmd-gpio = <&gpio0 30 0>;
            modes-map = <NS_V2_LED_OFF  0 1
                         NS_V2_LED_ON   1 0
                         NS_V2_LED_ON   0 0
                         NS_V2_LED_SATA 1 1>;
        };
    };
...