Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/cznic,turris-omnia-leds.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: CZ.NIC's Turris Omnia LEDs driver
0008 
0009 maintainers:
0010   - Marek Behún <kabel@kernel.org>
0011 
0012 description:
0013   This module adds support for the RGB LEDs found on the front panel of the
0014   Turris Omnia router. There are 12 RGB LEDs that are controlled by a
0015   microcontroller that communicates via the I2C bus. Each LED is described
0016   as a subnode of this I2C device.
0017 
0018 properties:
0019   compatible:
0020     const: cznic,turris-omnia-leds
0021 
0022   reg:
0023     description: I2C slave address of the microcontroller.
0024     maxItems: 1
0025 
0026   "#address-cells":
0027     const: 1
0028 
0029   "#size-cells":
0030     const: 0
0031 
0032 patternProperties:
0033   "^multi-led@[0-9a-b]$":
0034     type: object
0035     $ref: leds-class-multicolor.yaml#
0036     unevaluatedProperties: false
0037 
0038     description:
0039       This node represents one of the RGB LED devices on Turris Omnia.
0040       No subnodes need to be added for subchannels since this controller only
0041       supports RGB LEDs.
0042 
0043     properties:
0044       reg:
0045         minimum: 0
0046         maximum: 11
0047         description:
0048           This property identifies one of the LEDs on the front panel of the
0049           Turris Omnia router.
0050 
0051     required:
0052       - reg
0053 
0054 additionalProperties: false
0055 
0056 examples:
0057   - |
0058 
0059     #include <dt-bindings/leds/common.h>
0060 
0061     i2c0 {
0062         #address-cells = <1>;
0063         #size-cells = <0>;
0064 
0065         led-controller@2b {
0066             compatible = "cznic,turris-omnia-leds";
0067             reg = <0x2b>;
0068             #address-cells = <1>;
0069             #size-cells = <0>;
0070 
0071             multi-led@0 {
0072                 /*
0073                  * No subnodes are needed, this controller only supports RGB
0074                  * LEDs.
0075                  */
0076                 reg = <0>;
0077                 color = <LED_COLOR_ID_MULTI>;
0078                 function = LED_FUNCTION_POWER;
0079                 linux,default-trigger = "heartbeat";
0080             };
0081 
0082             multi-led@a {
0083                 reg = <0xa>;
0084                 color = <LED_COLOR_ID_MULTI>;
0085                 function = LED_FUNCTION_INDICATOR;
0086                 function-enumerator = <1>;
0087             };
0088         };
0089     };
0090 
0091 ...