register-bit-led.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Device Tree Bindings for Register Bit LEDs
  2. Register bit leds are used with syscon multifunctional devices
  3. where single bits in a certain register can turn on/off a
  4. single LED. The register bit LEDs appear as children to the
  5. syscon device, with the proper compatible string. For the
  6. syscon bindings see:
  7. Documentation/devicetree/bindings/mfd/syscon.txt
  8. Each LED is represented as a sub-node of the syscon device. Each
  9. node's name represents the name of the corresponding LED.
  10. LED sub-node properties:
  11. Required properties:
  12. - compatible : must be "register-bit-led"
  13. - offset : register offset to the register controlling this LED
  14. - mask : bit mask for the bit controlling this LED in the register
  15. typically 0x01, 0x02, 0x04 ...
  16. Optional properties:
  17. - label : (optional)
  18. see Documentation/devicetree/bindings/leds/common.txt
  19. - linux,default-trigger : (optional)
  20. see Documentation/devicetree/bindings/leds/common.txt
  21. - default-state: (optional) The initial state of the LED. Valid
  22. values are "on", "off", and "keep". If the LED is already on or off
  23. and the default-state property is set the to same value, then no
  24. glitch should be produced where the LED momentarily turns off (or
  25. on). The "keep" setting will keep the LED at whatever its current
  26. state is, without producing a glitch. The default is off if this
  27. property is not present.
  28. Example:
  29. syscon: syscon@10000000 {
  30. compatible = "arm,realview-pb1176-syscon", "syscon";
  31. reg = <0x10000000 0x1000>;
  32. led@08.0 {
  33. compatible = "register-bit-led";
  34. offset = <0x08>;
  35. mask = <0x01>;
  36. label = "versatile:0";
  37. linux,default-trigger = "heartbeat";
  38. default-state = "on";
  39. };
  40. led@08.1 {
  41. compatible = "register-bit-led";
  42. offset = <0x08>;
  43. mask = <0x02>;
  44. label = "versatile:1";
  45. linux,default-trigger = "mmc0";
  46. default-state = "off";
  47. };
  48. led@08.2 {
  49. compatible = "register-bit-led";
  50. offset = <0x08>;
  51. mask = <0x04>;
  52. label = "versatile:2";
  53. linux,default-trigger = "cpu0";
  54. default-state = "off";
  55. };
  56. led@08.3 {
  57. compatible = "register-bit-led";
  58. offset = <0x08>;
  59. mask = <0x08>;
  60. label = "versatile:3";
  61. default-state = "off";
  62. };
  63. led@08.4 {
  64. compatible = "register-bit-led";
  65. offset = <0x08>;
  66. mask = <0x10>;
  67. label = "versatile:4";
  68. default-state = "off";
  69. };
  70. led@08.5 {
  71. compatible = "register-bit-led";
  72. offset = <0x08>;
  73. mask = <0x20>;
  74. label = "versatile:5";
  75. default-state = "off";
  76. };
  77. led@08.6 {
  78. compatible = "register-bit-led";
  79. offset = <0x08>;
  80. mask = <0x40>;
  81. label = "versatile:6";
  82. default-state = "off";
  83. };
  84. led@08.7 {
  85. compatible = "register-bit-led";
  86. offset = <0x08>;
  87. mask = <0x80>;
  88. label = "versatile:7";
  89. default-state = "off";
  90. };
  91. };