register-bit-led.yaml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. title: Register Bit LEDs
  7. maintainers:
  8. - Linus Walleij <linusw@kernel.org>
  9. description: |+
  10. Register bit leds are used with syscon multifunctional devices where single
  11. bits in a certain register can turn on/off a single LED. The register bit LEDs
  12. appear as children to the syscon device, with the proper compatible string.
  13. For the syscon bindings see:
  14. Documentation/devicetree/bindings/mfd/syscon.yaml
  15. allOf:
  16. - $ref: /schemas/leds/common.yaml#
  17. properties:
  18. $nodename:
  19. description:
  20. The unit-address is in the form of @<reg addr>,<bit offset>
  21. pattern: '^led@[0-9a-f]+,[0-9a-f]{1,2}$'
  22. compatible:
  23. const: register-bit-led
  24. reg:
  25. description:
  26. The register address and size
  27. maxItems: 1
  28. mask:
  29. description:
  30. bit mask for the bit controlling this LED in the register
  31. $ref: /schemas/types.yaml#/definitions/uint32
  32. enum:
  33. [ 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
  34. 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000, 0x80000,
  35. 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000,
  36. 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000 ]
  37. offset:
  38. description:
  39. register offset to the register controlling this LED
  40. $ref: /schemas/types.yaml#/definitions/uint32
  41. deprecated: true
  42. required:
  43. - compatible
  44. - mask
  45. - reg
  46. unevaluatedProperties: false
  47. examples:
  48. - |
  49. syscon@10000000 {
  50. compatible = "arm,realview-pb1176-syscon", "syscon", "simple-mfd";
  51. reg = <0x10000000 0x1000>;
  52. #address-cells = <1>;
  53. #size-cells = <1>;
  54. ranges = <0x0 0x10000000 0x1000>;
  55. led@8,0 {
  56. compatible = "register-bit-led";
  57. reg = <0x08 0x04>;
  58. offset = <0x08>;
  59. mask = <0x01>;
  60. label = "versatile:0";
  61. linux,default-trigger = "heartbeat";
  62. default-state = "on";
  63. };
  64. led@8,1 {
  65. compatible = "register-bit-led";
  66. reg = <0x08 0x04>;
  67. offset = <0x08>;
  68. mask = <0x02>;
  69. label = "versatile:1";
  70. default-state = "off";
  71. };
  72. led@8,2 {
  73. compatible = "register-bit-led";
  74. reg = <0x08 0x04>;
  75. offset = <0x08>;
  76. mask = <0x04>;
  77. label = "versatile:2";
  78. default-state = "off";
  79. };
  80. };
  81. ...