xref: /freebsd/sys/contrib/device-tree/Bindings/leds/awinic,aw200xx.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1f126890aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2f126890aSEmmanuel Vadot%YAML 1.2
3f126890aSEmmanuel Vadot---
4f126890aSEmmanuel Vadot$id: http://devicetree.org/schemas/leds/awinic,aw200xx.yaml#
5f126890aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6f126890aSEmmanuel Vadot
7f126890aSEmmanuel Vadottitle: AWINIC AW200XX LED
8f126890aSEmmanuel Vadot
9f126890aSEmmanuel Vadotmaintainers:
10f126890aSEmmanuel Vadot  - Martin Kurbanov <mmkurbanov@sberdevices.ru>
11f126890aSEmmanuel Vadot
12f126890aSEmmanuel Vadotdescription: |
138d13bc63SEmmanuel Vadot  It is a matrix LED driver programmed via an I2C interface. Devices have
148d13bc63SEmmanuel Vadot  a set of individually controlled leds and support 3 pattern controllers
158d13bc63SEmmanuel Vadot  for auto breathing or group dimming control. Supported devices:
168d13bc63SEmmanuel Vadot    - AW20036 (3x12) 36 LEDs
178d13bc63SEmmanuel Vadot    - AW20054 (6x9)  54 LEDs
188d13bc63SEmmanuel Vadot    - AW20072 (6x12) 72 LEDs
198d13bc63SEmmanuel Vadot    - AW20108 (9x12) 108 LEDs
20f126890aSEmmanuel Vadot
21f126890aSEmmanuel Vadot  For more product information please see the link below:
22f126890aSEmmanuel Vadot  aw20036 - https://www.awinic.com/en/productDetail/AW20036QNR#tech-docs
23f126890aSEmmanuel Vadot  aw20054 - https://www.awinic.com/en/productDetail/AW20054QNR#tech-docs
24f126890aSEmmanuel Vadot  aw20072 - https://www.awinic.com/en/productDetail/AW20072QNR#tech-docs
258d13bc63SEmmanuel Vadot  aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs
26f126890aSEmmanuel Vadot
27f126890aSEmmanuel Vadotproperties:
28f126890aSEmmanuel Vadot  compatible:
29f126890aSEmmanuel Vadot    enum:
30f126890aSEmmanuel Vadot      - awinic,aw20036
31f126890aSEmmanuel Vadot      - awinic,aw20054
32f126890aSEmmanuel Vadot      - awinic,aw20072
338d13bc63SEmmanuel Vadot      - awinic,aw20108
34f126890aSEmmanuel Vadot
35f126890aSEmmanuel Vadot  reg:
36f126890aSEmmanuel Vadot    maxItems: 1
37f126890aSEmmanuel Vadot
38f126890aSEmmanuel Vadot  "#address-cells":
39f126890aSEmmanuel Vadot    const: 1
40f126890aSEmmanuel Vadot
41f126890aSEmmanuel Vadot  "#size-cells":
42f126890aSEmmanuel Vadot    const: 0
43f126890aSEmmanuel Vadot
448d13bc63SEmmanuel Vadot  enable-gpios:
458d13bc63SEmmanuel Vadot    maxItems: 1
46f126890aSEmmanuel Vadot
47f126890aSEmmanuel VadotpatternProperties:
488d13bc63SEmmanuel Vadot  "^led@[0-9a-f]+$":
49f126890aSEmmanuel Vadot    type: object
50f126890aSEmmanuel Vadot    $ref: common.yaml#
51f126890aSEmmanuel Vadot    unevaluatedProperties: false
52f126890aSEmmanuel Vadot
53f126890aSEmmanuel Vadot    properties:
54f126890aSEmmanuel Vadot      reg:
55f126890aSEmmanuel Vadot        description:
56f126890aSEmmanuel Vadot          LED number
57f126890aSEmmanuel Vadot        maxItems: 1
58f126890aSEmmanuel Vadot
59f126890aSEmmanuel Vadot      led-max-microamp:
60f126890aSEmmanuel Vadot        default: 9780
61f126890aSEmmanuel Vadot        description: |
62f126890aSEmmanuel Vadot          Note that a driver will take the minimum of all LED limits
63f126890aSEmmanuel Vadot          since the chip has a single global setting.
64f126890aSEmmanuel Vadot          The maximum output current of each LED is calculated by the
65f126890aSEmmanuel Vadot          following formula:
668d13bc63SEmmanuel Vadot            IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number)
67f126890aSEmmanuel Vadot          And the minimum output current formula:
688d13bc63SEmmanuel Vadot            IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number)
69*b2d2a78aSEmmanuel Vadot          where max-current-switch-number is determined by led configuration
708d13bc63SEmmanuel Vadot          and depends on how leds are physically connected to the led driver.
71f126890aSEmmanuel Vadot
72f126890aSEmmanuel VadotallOf:
73f126890aSEmmanuel Vadot  - if:
74f126890aSEmmanuel Vadot      properties:
75f126890aSEmmanuel Vadot        compatible:
76f126890aSEmmanuel Vadot          contains:
77f126890aSEmmanuel Vadot            const: awinic,aw20036
78f126890aSEmmanuel Vadot    then:
798d13bc63SEmmanuel Vadot      patternProperties:
808d13bc63SEmmanuel Vadot        "^led@[0-9a-f]+$":
81f126890aSEmmanuel Vadot          properties:
828d13bc63SEmmanuel Vadot            reg:
838d13bc63SEmmanuel Vadot              items:
848d13bc63SEmmanuel Vadot                minimum: 0
858d13bc63SEmmanuel Vadot                maximum: 36
868d13bc63SEmmanuel Vadot
878d13bc63SEmmanuel Vadot  - if:
88f126890aSEmmanuel Vadot      properties:
898d13bc63SEmmanuel Vadot        compatible:
908d13bc63SEmmanuel Vadot          contains:
918d13bc63SEmmanuel Vadot            const: awinic,aw20054
928d13bc63SEmmanuel Vadot    then:
938d13bc63SEmmanuel Vadot      patternProperties:
948d13bc63SEmmanuel Vadot        "^led@[0-9a-f]+$":
958d13bc63SEmmanuel Vadot          properties:
968d13bc63SEmmanuel Vadot            reg:
978d13bc63SEmmanuel Vadot              items:
988d13bc63SEmmanuel Vadot                minimum: 0
998d13bc63SEmmanuel Vadot                maximum: 54
1008d13bc63SEmmanuel Vadot
1018d13bc63SEmmanuel Vadot  - if:
1028d13bc63SEmmanuel Vadot      properties:
1038d13bc63SEmmanuel Vadot        compatible:
1048d13bc63SEmmanuel Vadot          contains:
1058d13bc63SEmmanuel Vadot            const: awinic,aw20072
1068d13bc63SEmmanuel Vadot    then:
1078d13bc63SEmmanuel Vadot      patternProperties:
1088d13bc63SEmmanuel Vadot        "^led@[0-9a-f]+$":
1098d13bc63SEmmanuel Vadot          properties:
1108d13bc63SEmmanuel Vadot            reg:
1118d13bc63SEmmanuel Vadot              items:
1128d13bc63SEmmanuel Vadot                minimum: 0
1138d13bc63SEmmanuel Vadot                maximum: 72
1148d13bc63SEmmanuel Vadot
1158d13bc63SEmmanuel Vadot  - if:
1168d13bc63SEmmanuel Vadot      properties:
1178d13bc63SEmmanuel Vadot        compatible:
1188d13bc63SEmmanuel Vadot          contains:
1198d13bc63SEmmanuel Vadot            const: awinic,aw20108
1208d13bc63SEmmanuel Vadot    then:
1218d13bc63SEmmanuel Vadot      patternProperties:
1228d13bc63SEmmanuel Vadot        "^led@[0-9a-f]+$":
1238d13bc63SEmmanuel Vadot          properties:
1248d13bc63SEmmanuel Vadot            reg:
1258d13bc63SEmmanuel Vadot              items:
1268d13bc63SEmmanuel Vadot                minimum: 0
1278d13bc63SEmmanuel Vadot                maximum: 108
1288d13bc63SEmmanuel Vadot
1298d13bc63SEmmanuel Vadotrequired:
1308d13bc63SEmmanuel Vadot  - compatible
1318d13bc63SEmmanuel Vadot  - reg
1328d13bc63SEmmanuel Vadot  - "#address-cells"
1338d13bc63SEmmanuel Vadot  - "#size-cells"
134f126890aSEmmanuel Vadot
135f126890aSEmmanuel VadotadditionalProperties: false
136f126890aSEmmanuel Vadot
137f126890aSEmmanuel Vadotexamples:
138f126890aSEmmanuel Vadot  - |
1398d13bc63SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
140f126890aSEmmanuel Vadot    #include <dt-bindings/leds/common.h>
141f126890aSEmmanuel Vadot
142f126890aSEmmanuel Vadot    i2c {
143f126890aSEmmanuel Vadot        #address-cells = <1>;
144f126890aSEmmanuel Vadot        #size-cells = <0>;
145f126890aSEmmanuel Vadot
146f126890aSEmmanuel Vadot        led-controller@3a {
147f126890aSEmmanuel Vadot            compatible = "awinic,aw20036";
148f126890aSEmmanuel Vadot            reg = <0x3a>;
149f126890aSEmmanuel Vadot            #address-cells = <1>;
150f126890aSEmmanuel Vadot            #size-cells = <0>;
1518d13bc63SEmmanuel Vadot            enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
152f126890aSEmmanuel Vadot
153f126890aSEmmanuel Vadot            led@0 {
154f126890aSEmmanuel Vadot                reg = <0x0>;
155f126890aSEmmanuel Vadot                color = <LED_COLOR_ID_RED>;
156f126890aSEmmanuel Vadot                led-max-microamp = <9780>;
157f126890aSEmmanuel Vadot            };
158f126890aSEmmanuel Vadot
159f126890aSEmmanuel Vadot            led@1 {
160f126890aSEmmanuel Vadot                reg = <0x1>;
161f126890aSEmmanuel Vadot                color = <LED_COLOR_ID_GREEN>;
162f126890aSEmmanuel Vadot                led-max-microamp = <9780>;
163f126890aSEmmanuel Vadot            };
164f126890aSEmmanuel Vadot
165f126890aSEmmanuel Vadot            led@2 {
166f126890aSEmmanuel Vadot                reg = <0x2>;
167f126890aSEmmanuel Vadot                color = <LED_COLOR_ID_BLUE>;
168f126890aSEmmanuel Vadot                led-max-microamp = <9780>;
169f126890aSEmmanuel Vadot            };
170f126890aSEmmanuel Vadot        };
171f126890aSEmmanuel Vadot    };
172f126890aSEmmanuel Vadot
173f126890aSEmmanuel Vadot...
174