Register Bit LEDs
Schema identifier ($id): "http://devicetree.org/schemas/leds/register-bit-led.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Linus Walleij <linusw@kernel.org>"
Register bit leds are used with syscon multifunctional devices where single bits in a certain register can turn on/off a single LED. The register bit LEDs appear as children to the syscon device, with the proper compatible string. For the syscon bindings see: Documentation/devicetree/bindings/mfd/syscon.yaml
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):/schemas/leds/common.yaml#
Properties and child nodes (properties) #
$nodename — not listed as required here #
The unit-address is in the form of @<reg addr>,<bit offset>
String pattern (pattern): "^led@[0-9a-f]+,[0-9a-f]{1,2}$"
compatible — required here #
Exact value (const): "register-bit-led"
reg — required here #
The register address and size
Maximum number of items (maxItems): 1
mask — required here #
bit mask for the bit controlling this LED in the register
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
Allowed values (enum): 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648
offset — not listed as required here #
register offset to the register controlling this LED
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
Deprecated (deprecated): true
Required in this object (required): "compatible", "mask", "reg"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Examples (examples) #
syscon@10000000 {
compatible = "arm,realview-pb1176-syscon", "syscon", "simple-mfd";
reg = <0x10000000 0x1000>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x10000000 0x1000>;
led@8,0 {
compatible = "register-bit-led";
reg = <0x08 0x04>;
offset = <0x08>;
mask = <0x01>;
label = "versatile:0";
linux,default-trigger = "heartbeat";
default-state = "on";
};
led@8,1 {
compatible = "register-bit-led";
reg = <0x08 0x04>;
offset = <0x08>;
mask = <0x02>;
label = "versatile:1";
default-state = "off";
};
led@8,2 {
compatible = "register-bit-led";
reg = <0x08 0x04>;
offset = <0x08>;
mask = <0x04>;
label = "versatile:2";
default-state = "off";
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)