ti,lp5812.yaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/ti,lp5812.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: TI LP5812 4x3 Matrix RGB LED Driver with Autonomous Control
  7. maintainers:
  8. - Nam Tran <trannamatk@gmail.com>
  9. description: |
  10. The LP5812 is a 4x3 matrix RGB LED driver with I2C interface
  11. and autonomous animation engine control.
  12. For more product information please see the link below:
  13. https://www.ti.com/product/LP5812#tech-docs
  14. properties:
  15. compatible:
  16. const: ti,lp5812
  17. reg:
  18. maxItems: 1
  19. ti,scan-mode:
  20. description: |
  21. Selects the LED scan mode of the LP5812. The device supports
  22. three modes:
  23. - Direct-drive mode (by default if 'ti,scan-mode' is omitted)
  24. drives up to 4 LEDs directly by internal current sinks (LED0-LED3).
  25. - TCM-drive mode ("tcm:<n>:<order...>") drives up to 12 LEDs
  26. (4 RGB) using 1-4 scan multiplexing. The <n> specifies the number
  27. of scans (1-4), and <order...> defines the scan order of the outputs.
  28. - Mix-drive mode ("mix:<n>:<direct>:<order...>") combines
  29. direct-drive and TCM-drive outputs. The <n> specifies the number
  30. of scans, <direct> selects the direct-drive outputs, and <order...>
  31. defines the scan order.
  32. $ref: /schemas/types.yaml#/definitions/string
  33. pattern: '^(tcm|mix):[1-4](:[0-3]){1,4}$'
  34. vcc-supply:
  35. description: Regulator providing power to the 'VCC' pin.
  36. "#address-cells":
  37. const: 1
  38. "#size-cells":
  39. const: 0
  40. patternProperties:
  41. "^led@[0-3]$":
  42. type: object
  43. $ref: common.yaml#
  44. unevaluatedProperties: false
  45. properties:
  46. reg:
  47. minimum: 0
  48. maximum: 3
  49. required:
  50. - reg
  51. "^multi-led@[4-7]$":
  52. type: object
  53. $ref: leds-class-multicolor.yaml#
  54. unevaluatedProperties: false
  55. properties:
  56. reg:
  57. minimum: 4
  58. maximum: 7
  59. "#address-cells":
  60. const: 1
  61. "#size-cells":
  62. const: 0
  63. patternProperties:
  64. "^led@[4-9a-f]$":
  65. type: object
  66. $ref: common.yaml#
  67. unevaluatedProperties: false
  68. properties:
  69. reg:
  70. minimum: 4
  71. maximum: 15
  72. required:
  73. - reg
  74. required:
  75. - compatible
  76. - reg
  77. additionalProperties: false
  78. examples:
  79. - |
  80. #include <dt-bindings/leds/common.h>
  81. i2c {
  82. #address-cells = <1>;
  83. #size-cells = <0>;
  84. led-controller@1b {
  85. #address-cells = <1>;
  86. #size-cells = <0>;
  87. compatible = "ti,lp5812";
  88. reg = <0x1b>;
  89. ti,scan-mode = "tcm:4:0:1:2:3";
  90. vcc-supply = <&vdd_3v3_reg>;
  91. led@0 {
  92. reg = <0x0>;
  93. label = "LED0";
  94. led-max-microamp = <25500>;
  95. };
  96. led@1 {
  97. reg = <0x1>;
  98. label = "LED1";
  99. led-max-microamp = <25500>;
  100. };
  101. led@2 {
  102. reg = <0x2>;
  103. label = "LED2";
  104. led-max-microamp = <25500>;
  105. };
  106. led@3 {
  107. reg = <0x3>;
  108. label = "LED3";
  109. led-max-microamp = <25500>;
  110. };
  111. multi-led@4 {
  112. #address-cells = <1>;
  113. #size-cells = <0>;
  114. reg = <0x4>;
  115. color = <LED_COLOR_ID_RGB>;
  116. label = "LED_A";
  117. led@4 {
  118. reg = <0x4>;
  119. color = <LED_COLOR_ID_GREEN>;
  120. led-max-microamp = <25500>;
  121. };
  122. led@5 {
  123. reg = <0x5>;
  124. color = <LED_COLOR_ID_RED>;
  125. led-max-microamp = <25500>;
  126. };
  127. led@6 {
  128. reg = <0x6>;
  129. color = <LED_COLOR_ID_BLUE>;
  130. led-max-microamp = <25500>;
  131. };
  132. };
  133. multi-led@5 {
  134. #address-cells = <1>;
  135. #size-cells = <0>;
  136. reg = <0x5>;
  137. color = <LED_COLOR_ID_RGB>;
  138. label = "LED_B";
  139. led@7 {
  140. reg = <0x7>;
  141. color = <LED_COLOR_ID_GREEN>;
  142. led-max-microamp = <25500>;
  143. };
  144. led@8 {
  145. reg = <0x8>;
  146. color = <LED_COLOR_ID_RED>;
  147. led-max-microamp = <25500>;
  148. };
  149. led@9 {
  150. reg = <0x9>;
  151. color = <LED_COLOR_ID_BLUE>;
  152. led-max-microamp = <25500>;
  153. };
  154. };
  155. multi-led@6 {
  156. #address-cells = <1>;
  157. #size-cells = <0>;
  158. reg = <0x6>;
  159. color = <LED_COLOR_ID_RGB>;
  160. label = "LED_C";
  161. led@a {
  162. reg = <0xa>;
  163. color = <LED_COLOR_ID_GREEN>;
  164. led-max-microamp = <25500>;
  165. };
  166. led@b {
  167. reg = <0xb>;
  168. color = <LED_COLOR_ID_RED>;
  169. led-max-microamp = <25500>;
  170. };
  171. led@c {
  172. reg = <0xc>;
  173. color = <LED_COLOR_ID_BLUE>;
  174. led-max-microamp = <25500>;
  175. };
  176. };
  177. multi-led@7 {
  178. #address-cells = <1>;
  179. #size-cells = <0>;
  180. reg = <0x7>;
  181. color = <LED_COLOR_ID_RGB>;
  182. label = "LED_D";
  183. led@d {
  184. reg = <0xd>;
  185. color = <LED_COLOR_ID_GREEN>;
  186. led-max-microamp = <25500>;
  187. };
  188. led@e {
  189. reg = <0xe>;
  190. color = <LED_COLOR_ID_RED>;
  191. led-max-microamp = <25500>;
  192. };
  193. led@f {
  194. reg = <0xf>;
  195. color = <LED_COLOR_ID_BLUE>;
  196. led-max-microamp = <25500>;
  197. };
  198. };
  199. };
  200. };
  201. ...