18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/leds/register-bit-led.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Register Bit LEDs
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription: |+
138cc087a1SEmmanuel Vadot  Register bit leds are used with syscon multifunctional devices where single
148cc087a1SEmmanuel Vadot  bits in a certain register can turn on/off a single LED. The register bit LEDs
158cc087a1SEmmanuel Vadot  appear as children to the syscon device, with the proper compatible string.
168cc087a1SEmmanuel Vadot  For the syscon bindings see:
178cc087a1SEmmanuel Vadot  Documentation/devicetree/bindings/mfd/syscon.yaml
188cc087a1SEmmanuel Vadot
198cc087a1SEmmanuel VadotallOf:
208cc087a1SEmmanuel Vadot  - $ref: /schemas/leds/common.yaml#
218cc087a1SEmmanuel Vadot
228cc087a1SEmmanuel Vadotproperties:
238cc087a1SEmmanuel Vadot  $nodename:
248cc087a1SEmmanuel Vadot    description:
258cc087a1SEmmanuel Vadot      The unit-address is in the form of @<reg addr>,<bit offset>
268cc087a1SEmmanuel Vadot    pattern: '^led@[0-9a-f]+,[0-9a-f]{1,2}$'
278cc087a1SEmmanuel Vadot
288cc087a1SEmmanuel Vadot  compatible:
298cc087a1SEmmanuel Vadot    const: register-bit-led
308cc087a1SEmmanuel Vadot
318cc087a1SEmmanuel Vadot  reg:
328cc087a1SEmmanuel Vadot    description:
338cc087a1SEmmanuel Vadot      The register address and size
348cc087a1SEmmanuel Vadot    maxItems: 1
358cc087a1SEmmanuel Vadot
368cc087a1SEmmanuel Vadot  mask:
378cc087a1SEmmanuel Vadot    description:
388cc087a1SEmmanuel Vadot      bit mask for the bit controlling this LED in the register
398cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
408cc087a1SEmmanuel Vadot    enum:
418cc087a1SEmmanuel Vadot      [ 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
428cc087a1SEmmanuel Vadot        0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000, 0x80000,
438cc087a1SEmmanuel Vadot        0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000,
448cc087a1SEmmanuel Vadot        0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000 ]
458cc087a1SEmmanuel Vadot
468cc087a1SEmmanuel Vadot  offset:
478cc087a1SEmmanuel Vadot    description:
488cc087a1SEmmanuel Vadot      register offset to the register controlling this LED
498cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
508cc087a1SEmmanuel Vadot    deprecated: true
518cc087a1SEmmanuel Vadot
528cc087a1SEmmanuel Vadotrequired:
538cc087a1SEmmanuel Vadot  - compatible
548cc087a1SEmmanuel Vadot  - mask
558cc087a1SEmmanuel Vadot  - reg
568cc087a1SEmmanuel Vadot
578cc087a1SEmmanuel VadotunevaluatedProperties: false
588cc087a1SEmmanuel Vadot
598cc087a1SEmmanuel Vadotexamples:
608cc087a1SEmmanuel Vadot  - |
618cc087a1SEmmanuel Vadot
628cc087a1SEmmanuel Vadot    syscon@10000000 {
63*84943d6fSEmmanuel Vadot        compatible = "arm,realview-pb1176-syscon", "syscon", "simple-mfd";
648cc087a1SEmmanuel Vadot        reg = <0x10000000 0x1000>;
658cc087a1SEmmanuel Vadot        #address-cells = <1>;
668cc087a1SEmmanuel Vadot        #size-cells = <1>;
678cc087a1SEmmanuel Vadot        ranges = <0x0 0x10000000 0x1000>;
688cc087a1SEmmanuel Vadot
698cc087a1SEmmanuel Vadot        led@8,0 {
708cc087a1SEmmanuel Vadot            compatible = "register-bit-led";
718cc087a1SEmmanuel Vadot            reg = <0x08 0x04>;
728cc087a1SEmmanuel Vadot            offset = <0x08>;
738cc087a1SEmmanuel Vadot            mask = <0x01>;
748cc087a1SEmmanuel Vadot            label = "versatile:0";
758cc087a1SEmmanuel Vadot            linux,default-trigger = "heartbeat";
768cc087a1SEmmanuel Vadot            default-state = "on";
778cc087a1SEmmanuel Vadot        };
788cc087a1SEmmanuel Vadot        led@8,1 {
798cc087a1SEmmanuel Vadot            compatible = "register-bit-led";
808cc087a1SEmmanuel Vadot            reg = <0x08 0x04>;
818cc087a1SEmmanuel Vadot            offset = <0x08>;
828cc087a1SEmmanuel Vadot            mask = <0x02>;
838cc087a1SEmmanuel Vadot            label = "versatile:1";
848cc087a1SEmmanuel Vadot            default-state = "off";
858cc087a1SEmmanuel Vadot        };
868cc087a1SEmmanuel Vadot        led@8,2 {
878cc087a1SEmmanuel Vadot            compatible = "register-bit-led";
888cc087a1SEmmanuel Vadot            reg = <0x08 0x04>;
898cc087a1SEmmanuel Vadot            offset = <0x08>;
908cc087a1SEmmanuel Vadot            mask = <0x04>;
918cc087a1SEmmanuel Vadot            label = "versatile:2";
928cc087a1SEmmanuel Vadot            default-state = "off";
938cc087a1SEmmanuel Vadot        };
948cc087a1SEmmanuel Vadot    };
958cc087a1SEmmanuel Vadot...
96