0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/register-bit-led.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Device Tree Bindings for Register Bit LEDs
0008
0009 maintainers:
0010 - Linus Walleij <linus.walleij@linaro.org>
0011
0012 description: |+
0013 Register bit leds are used with syscon multifunctional devices where single
0014 bits in a certain register can turn on/off a single LED. The register bit LEDs
0015 appear as children to the syscon device, with the proper compatible string.
0016 For the syscon bindings see:
0017 Documentation/devicetree/bindings/mfd/syscon.yaml
0018
0019 allOf:
0020 - $ref: /schemas/leds/common.yaml#
0021
0022 properties:
0023 $nodename:
0024 description:
0025 The unit-address is in the form of @<reg addr>,<bit offset>
0026 pattern: '^led@[0-9a-f]+,[0-9a-f]{1,2}$'
0027
0028 compatible:
0029 const: register-bit-led
0030
0031 reg:
0032 description:
0033 The register address and size
0034 maxItems: 1
0035
0036 mask:
0037 description:
0038 bit mask for the bit controlling this LED in the register
0039 $ref: /schemas/types.yaml#/definitions/uint32
0040 enum:
0041 [ 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
0042 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000, 0x80000,
0043 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000,
0044 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000 ]
0045
0046 offset:
0047 description:
0048 register offset to the register controlling this LED
0049 $ref: /schemas/types.yaml#/definitions/uint32
0050 deprecated: true
0051
0052 required:
0053 - compatible
0054 - mask
0055 - reg
0056
0057 unevaluatedProperties: false
0058
0059 examples:
0060 - |
0061
0062 syscon@10000000 {
0063 compatible = "arm,realview-pb1176-syscon", "syscon";
0064 reg = <0x10000000 0x1000>;
0065 #address-cells = <1>;
0066 #size-cells = <1>;
0067 ranges = <0x0 0x10000000 0x1000>;
0068
0069 led@8,0 {
0070 compatible = "register-bit-led";
0071 reg = <0x08 0x04>;
0072 offset = <0x08>;
0073 mask = <0x01>;
0074 label = "versatile:0";
0075 linux,default-trigger = "heartbeat";
0076 default-state = "on";
0077 };
0078 led@8,1 {
0079 compatible = "register-bit-led";
0080 reg = <0x08 0x04>;
0081 offset = <0x08>;
0082 mask = <0x02>;
0083 label = "versatile:1";
0084 default-state = "off";
0085 };
0086 led@8,2 {
0087 compatible = "register-bit-led";
0088 reg = <0x08 0x04>;
0089 offset = <0x08>;
0090 mask = <0x04>;
0091 label = "versatile:2";
0092 default-state = "off";
0093 };
0094 };
0095 ...