summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/leds/leds-aw2013.yaml
blob: 08f3e1cfc1b1be21f9b0f1bd64fdbaf7fb196afa (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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-aw2013.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AWINIC AW2013 3-channel LED Driver

maintainers:
  - Nikita Travkin <nikitos.tr@gmail.com>

description: |
  The AW2013 is a 3-channel LED driver with I2C interface. It can control
  LED brightness with PWM output.

properties:
  compatible:
    const: awinic,aw2013

  reg:
    maxItems: 1

  vcc-supply:
    description: Regulator providing power to the "VCC" pin.

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

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

    properties:
      reg:
        description: Index of the LED.
        minimum: 0
        maximum: 2

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

additionalProperties: false

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

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

        led-controller@45 {
            compatible = "awinic,aw2013";
            reg = <0x45>;
            #address-cells = <1>;
            #size-cells = <0>;

            vcc-supply = <&pm8916_l17>;

            led@0 {
                reg = <0>;
                led-max-microamp = <5000>;
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_RED>;
            };

            led@1 {
                reg = <1>;
                led-max-microamp = <5000>;
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_GREEN>;
            };

            led@2 {
                reg = <2>;
                led-max-microamp = <5000>;
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_BLUE>;
            };
        };
    };
...