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