summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/leds/onnn,ncp5623.yaml
blob: 9c9f3a682ba2096fe44da12bfdb87b015c37c6cb (plain)
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
86
87
88
89
90
91
92
93
94
95
96
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/onnn,ncp5623.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ON Semiconductor NCP5623 multi-LED Driver

maintainers:
  - Abdel Alkuor <alkuor@gmail.com>

description:
  NCP5623 Triple Output I2C Controlled LED Driver.
  https://www.onsemi.com/pdf/datasheet/ncp5623-d.pdf

properties:
  compatible:
    enum:
      - onnn,ncp5623

  reg:
    const: 0x38

  multi-led:
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    properties:
      "#address-cells":
        const: 1

      "#size-cells":
        const: 0

    patternProperties:
      "^led@[0-2]$":
        type: object
        $ref: common.yaml#
        unevaluatedProperties: false

        properties:
          reg:
            minimum: 0
            maximum: 2

        required:
          - reg
          - color

    required:
      - "#address-cells"
      - "#size-cells"

required:
  - compatible
  - reg
  - multi-led

additionalProperties: false

examples:
  - |
    #include <dt-bindings/leds/common.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        led-controller@38 {
            compatible = "onnn,ncp5623";
            reg = <0x38>;

            multi-led {
                color = <LED_COLOR_ID_RGB>;

                #address-cells = <1>;
                #size-cells = <0>;

                led@0 {
                    reg = <0>;
                    color = <LED_COLOR_ID_RED>;
                };

                led@1 {
                    reg = <1>;
                    color = <LED_COLOR_ID_GREEN>;
                };

                led@2 {
                    reg = <2>;
                    color = <LED_COLOR_ID_BLUE>;
                };
            };
        };
    };