awinic,aw200xx.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/awinic,aw200xx.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: AWINIC AW200XX LED
  7. maintainers:
  8. - Martin Kurbanov <mmkurbanov@sberdevices.ru>
  9. description: |
  10. It is a matrix LED driver programmed via an I2C interface. Devices have
  11. a set of individually controlled leds and support 3 pattern controllers
  12. for auto breathing or group dimming control. Supported devices:
  13. - AW20036 (3x12) 36 LEDs
  14. - AW20054 (6x9) 54 LEDs
  15. - AW20072 (6x12) 72 LEDs
  16. - AW20108 (9x12) 108 LEDs
  17. For more product information please see the link below:
  18. aw20036 - https://www.awinic.com/en/productDetail/AW20036QNR#tech-docs
  19. aw20054 - https://www.awinic.com/en/productDetail/AW20054QNR#tech-docs
  20. aw20072 - https://www.awinic.com/en/productDetail/AW20072QNR#tech-docs
  21. aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs
  22. properties:
  23. compatible:
  24. enum:
  25. - awinic,aw20036
  26. - awinic,aw20054
  27. - awinic,aw20072
  28. - awinic,aw20108
  29. reg:
  30. maxItems: 1
  31. "#address-cells":
  32. const: 1
  33. "#size-cells":
  34. const: 0
  35. enable-gpios:
  36. maxItems: 1
  37. patternProperties:
  38. "^led@[0-9a-f]+$":
  39. type: object
  40. $ref: common.yaml#
  41. unevaluatedProperties: false
  42. properties:
  43. reg:
  44. description:
  45. LED number
  46. maxItems: 1
  47. led-max-microamp:
  48. default: 9780
  49. description: |
  50. Note that a driver will take the minimum of all LED limits
  51. since the chip has a single global setting.
  52. The maximum output current of each LED is calculated by the
  53. following formula:
  54. IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number)
  55. And the minimum output current formula:
  56. IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number)
  57. where max-current-switch-number is determined by led configuration
  58. and depends on how leds are physically connected to the led driver.
  59. allOf:
  60. - if:
  61. properties:
  62. compatible:
  63. contains:
  64. const: awinic,aw20036
  65. then:
  66. patternProperties:
  67. "^led@[0-9a-f]+$":
  68. properties:
  69. reg:
  70. items:
  71. minimum: 0
  72. maximum: 36
  73. - if:
  74. properties:
  75. compatible:
  76. contains:
  77. const: awinic,aw20054
  78. then:
  79. patternProperties:
  80. "^led@[0-9a-f]+$":
  81. properties:
  82. reg:
  83. items:
  84. minimum: 0
  85. maximum: 54
  86. - if:
  87. properties:
  88. compatible:
  89. contains:
  90. const: awinic,aw20072
  91. then:
  92. patternProperties:
  93. "^led@[0-9a-f]+$":
  94. properties:
  95. reg:
  96. items:
  97. minimum: 0
  98. maximum: 72
  99. - if:
  100. properties:
  101. compatible:
  102. contains:
  103. const: awinic,aw20108
  104. then:
  105. patternProperties:
  106. "^led@[0-9a-f]+$":
  107. properties:
  108. reg:
  109. items:
  110. minimum: 0
  111. maximum: 108
  112. required:
  113. - compatible
  114. - reg
  115. - "#address-cells"
  116. - "#size-cells"
  117. additionalProperties: false
  118. examples:
  119. - |
  120. #include <dt-bindings/gpio/gpio.h>
  121. #include <dt-bindings/leds/common.h>
  122. i2c {
  123. #address-cells = <1>;
  124. #size-cells = <0>;
  125. led-controller@3a {
  126. compatible = "awinic,aw20036";
  127. reg = <0x3a>;
  128. #address-cells = <1>;
  129. #size-cells = <0>;
  130. enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
  131. led@0 {
  132. reg = <0x0>;
  133. color = <LED_COLOR_ID_RED>;
  134. led-max-microamp = <9780>;
  135. };
  136. led@1 {
  137. reg = <0x1>;
  138. color = <LED_COLOR_ID_GREEN>;
  139. led-max-microamp = <9780>;
  140. };
  141. led@2 {
  142. reg = <0x2>;
  143. color = <LED_COLOR_ID_BLUE>;
  144. led-max-microamp = <9780>;
  145. };
  146. };
  147. };
  148. ...