CZ.NIC's Turris Omnia LEDs driver

Schema identifier ($id): "http://devicetree.org/schemas/leds/cznic,turris-omnia-leds.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Marek Behún <kabel@kernel.org>"

This module adds support for the RGB LEDs found on the front panel of the Turris Omnia router. There are 12 RGB LEDs that are controlled by a microcontroller that communicates via the I2C bus. Each LED is described as a subnode of this I2C device.

Properties and child nodes (properties) #

compatible — not listed as required here #

Exact value (const): "cznic,turris-omnia-leds"

reg — not listed as required here #

I2C slave address of the microcontroller.

Maximum number of items (maxItems): 1

interrupts — not listed as required here #

Specifier for the global LED brightness changed by front button press interrupt.

Maximum number of items (maxItems): 1

#address-cells — not listed as required here #

Exact value (const): 1

#size-cells — not listed as required here #

Exact value (const): 0

Properties matching a name pattern (patternProperties) #

^multi-led@[0-9a-b]$ — name matches this regular expression #

Value type (type): "object"

Shared schema rule ($ref): leds-class-multicolor.yaml#

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

This node represents one of the RGB LED devices on Turris Omnia. No subnodes need to be added for subchannels since this controller only supports RGB LEDs.

Properties and child nodes (properties) #

reg — required here

Minimum value (minimum): 0

Maximum value (maximum): 11

This property identifies one of the LEDs on the front panel of the Turris Omnia router.

Required in this object (required): "reg"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #


#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>

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

    led-controller@2b {
        compatible = "cznic,turris-omnia-leds";
        reg = <0x2b>;
        interrupts-extended = <&mcu 11 IRQ_TYPE_NONE>;
        #address-cells = <1>;
        #size-cells = <0>;

        multi-led@0 {
            /*
             * No subnodes are needed, this controller only supports RGB
             * LEDs.
             */
            reg = <0>;
            color = <LED_COLOR_ID_MULTI>;
            function = LED_FUNCTION_POWER;
            linux,default-trigger = "heartbeat";
        };

        multi-led@a {
            reg = <0xa>;
            color = <LED_COLOR_ID_MULTI>;
            function = LED_FUNCTION_INDICATOR;
            function-enumerator = <1>;
        };
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause

Edit this page