xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/leds/cznic,turris-omnia-leds.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: CZ.NIC's Turris Omnia LEDs driver
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Marek Behún <marek.behun@nic.cz>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyundescription:
13*4882a593Smuzhiyun  This module adds support for the RGB LEDs found on the front panel of the
14*4882a593Smuzhiyun  Turris Omnia router. There are 12 RGB LEDs that are controlled by a
15*4882a593Smuzhiyun  microcontroller that communicates via the I2C bus. Each LED is described
16*4882a593Smuzhiyun  as a subnode of this I2C device.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyunproperties:
19*4882a593Smuzhiyun  compatible:
20*4882a593Smuzhiyun    const: cznic,turris-omnia-leds
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  reg:
23*4882a593Smuzhiyun    description: I2C slave address of the microcontroller.
24*4882a593Smuzhiyun    maxItems: 1
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  "#address-cells":
27*4882a593Smuzhiyun    const: 1
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun  "#size-cells":
30*4882a593Smuzhiyun    const: 0
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunpatternProperties:
33*4882a593Smuzhiyun  "^multi-led@[0-9a-b]$":
34*4882a593Smuzhiyun    type: object
35*4882a593Smuzhiyun    allOf:
36*4882a593Smuzhiyun      - $ref: leds-class-multicolor.yaml#
37*4882a593Smuzhiyun    description:
38*4882a593Smuzhiyun      This node represents one of the RGB LED devices on Turris Omnia.
39*4882a593Smuzhiyun      No subnodes need to be added for subchannels since this controller only
40*4882a593Smuzhiyun      supports RGB LEDs.
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun    properties:
43*4882a593Smuzhiyun      reg:
44*4882a593Smuzhiyun        minimum: 0
45*4882a593Smuzhiyun        maximum: 11
46*4882a593Smuzhiyun        description:
47*4882a593Smuzhiyun          This property identifies one of the LEDs on the front panel of the
48*4882a593Smuzhiyun          Turris Omnia router.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    required:
51*4882a593Smuzhiyun      - reg
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunadditionalProperties: false
54*4882a593Smuzhiyun
55*4882a593Smuzhiyunexamples:
56*4882a593Smuzhiyun  - |
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    #include <dt-bindings/leds/common.h>
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun    i2c0 {
61*4882a593Smuzhiyun        #address-cells = <1>;
62*4882a593Smuzhiyun        #size-cells = <0>;
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun        led-controller@2b {
65*4882a593Smuzhiyun            compatible = "cznic,turris-omnia-leds";
66*4882a593Smuzhiyun            reg = <0x2b>;
67*4882a593Smuzhiyun            #address-cells = <1>;
68*4882a593Smuzhiyun            #size-cells = <0>;
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun            multi-led@0 {
71*4882a593Smuzhiyun                /*
72*4882a593Smuzhiyun                 * No subnodes are needed, this controller only supports RGB
73*4882a593Smuzhiyun                 * LEDs.
74*4882a593Smuzhiyun                 */
75*4882a593Smuzhiyun                reg = <0>;
76*4882a593Smuzhiyun                color = <LED_COLOR_ID_MULTI>;
77*4882a593Smuzhiyun                function = LED_FUNCTION_POWER;
78*4882a593Smuzhiyun                linux,default-trigger = "heartbeat";
79*4882a593Smuzhiyun            };
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun            multi-led@a {
82*4882a593Smuzhiyun                reg = <0xa>;
83*4882a593Smuzhiyun                color = <LED_COLOR_ID_MULTI>;
84*4882a593Smuzhiyun                function = LED_FUNCTION_INDICATOR;
85*4882a593Smuzhiyun                function-enumerator = <1>;
86*4882a593Smuzhiyun            };
87*4882a593Smuzhiyun        };
88*4882a593Smuzhiyun    };
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun...
91