xref: /linux/Documentation/devicetree/bindings/leds/register-bit-led.yaml (revision 604e4e44a7c2f2b18e466533b6ecece97c6e667d)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/register-bit-led.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Device Tree Bindings for Register Bit LEDs
8
9maintainers:
10  - Linus Walleij <linus.walleij@linaro.org>
11
12description: |+
13  Register bit leds are used with syscon multifunctional devices where single
14  bits in a certain register can turn on/off a single LED. The register bit LEDs
15  appear as children to the syscon device, with the proper compatible string.
16  For the syscon bindings see:
17  Documentation/devicetree/bindings/mfd/syscon.yaml
18
19allOf:
20  - $ref: /schemas/leds/common.yaml#
21
22properties:
23  compatible:
24    const: register-bit-led
25
26  mask:
27    description:
28      bit mask for the bit controlling this LED in the register
29    $ref: /schemas/types.yaml#/definitions/uint32
30    enum:
31      [ 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
32        0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000, 0x80000,
33        0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000,
34        0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000 ]
35
36  offset:
37    description:
38      register offset to the register controlling this LED
39    $ref: /schemas/types.yaml#/definitions/uint32
40
41required:
42  - compatible
43  - mask
44  - offset
45
46unevaluatedProperties: false
47
48examples:
49  - |
50
51    syscon@10000000 {
52        compatible = "arm,realview-pb1176-syscon", "syscon";
53        reg = <0x10000000 0x1000>;
54
55        led@8.0 {
56            compatible = "register-bit-led";
57            offset = <0x08>;
58            mask = <0x01>;
59            label = "versatile:0";
60            linux,default-trigger = "heartbeat";
61            default-state = "on";
62        };
63        led@8.1 {
64            compatible = "register-bit-led";
65            offset = <0x08>;
66            mask = <0x02>;
67            label = "versatile:1";
68            default-state = "off";
69        };
70        led@8.2 {
71            compatible = "register-bit-led";
72            offset = <0x08>;
73            mask = <0x04>;
74            label = "versatile:2";
75            default-state = "off";
76        };
77    };
78...
79