891-dt-bindings-leds-Add-LED1202-LED-Controller.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. From: Vicentiu Galanopulo <[email protected]>
  2. To: Pavel Machek <[email protected]>, Lee Jones <[email protected]>,
  3. Rob Herring <[email protected]>,
  4. Krzysztof Kozlowski <[email protected]>,
  5. Conor Dooley <[email protected]>,
  6. Jonathan Corbet <[email protected]>,
  7. Vicentiu Galanopulo <[email protected]>,
  8. [email protected], [email protected],
  9. [email protected], [email protected]
  10. Cc: Krzysztof Kozlowski <[email protected]>
  11. Subject: [PATCH v11 2/3] dt-bindings: leds: Add LED1202 LED Controller
  12. Date: Wed, 18 Dec 2024 18:33:58 +0000 [thread overview]
  13. Message-ID: <[email protected]> (raw)
  14. In-Reply-To: <[email protected]>
  15. The LED1202 is a 12-channel low quiescent current LED driver with:
  16. * Supply range from 2.6 V to 5 V
  17. * 20 mA current capability per channel
  18. * 1.8 V compatible I2C control interface
  19. * 8-bit analog dimming individual control
  20. * 12-bit local PWM resolution
  21. * 8 programmable patterns
  22. If the led node is present in the controller then the channel is
  23. set to active.
  24. Signed-off-by: Vicentiu Galanopulo <[email protected]>
  25. Reviewed-by: Krzysztof Kozlowski <[email protected]>
  26. ---
  27. v1: https://lore.kernel.org/lkml/ZnCnnQfwuRueCIQ0@admins-Air/T/
  28. v2: https://lore.kernel.org/all/ZniNdGgKyUMV-hjq@admins-Air/T/
  29. v3: https://lore.kernel.org/all/ZniNdGgKyUMV-hjq@admins-Air/T/
  30. Changes in v4:
  31. - remove label property, use devm_led_classdev_register_ext instead
  32. Changes in v3:
  33. - remove active property
  34. Changes in v2:
  35. - renamed label to remove color from it
  36. - add color property for each node
  37. - add function and function-enumerator property for each node
  38. .../devicetree/bindings/leds/st,led1202.yaml | 132 ++++++++++++++++++
  39. 1 file changed, 132 insertions(+)
  40. create mode 100644 Documentation/devicetree/bindings/leds/st,led1202.yaml
  41. --- /dev/null
  42. +++ b/Documentation/devicetree/bindings/leds/st,led1202.yaml
  43. @@ -0,0 +1,132 @@
  44. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  45. +%YAML 1.2
  46. +---
  47. +$id: http://devicetree.org/schemas/leds/st,led1202.yaml#
  48. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  49. +
  50. +title: ST LED1202 LED controllers
  51. +
  52. +maintainers:
  53. + - Vicentiu Galanopulo <[email protected]>
  54. +
  55. +description: |
  56. + The LED1202 is a 12-channel low quiescent current LED controller
  57. + programmable via I2C; The output current can be adjusted separately
  58. + for each channel by 8-bit analog and 12-bit digital dimming control.
  59. + Datasheet available at
  60. + https://www.st.com/en/power-management/led1202.html
  61. +
  62. +properties:
  63. + compatible:
  64. + const: st,led1202
  65. +
  66. + reg:
  67. + maxItems: 1
  68. +
  69. + "#address-cells":
  70. + const: 1
  71. +
  72. + "#size-cells":
  73. + const: 0
  74. +
  75. +patternProperties:
  76. + "^led@[0-9a-f]$":
  77. + type: object
  78. + $ref: common.yaml#
  79. + unevaluatedProperties: false
  80. +
  81. + properties:
  82. + reg:
  83. + minimum: 0
  84. + maximum: 11
  85. +
  86. + required:
  87. + - reg
  88. +
  89. +required:
  90. + - compatible
  91. + - reg
  92. + - "#address-cells"
  93. + - "#size-cells"
  94. +
  95. +additionalProperties: false
  96. +
  97. +examples:
  98. + - |
  99. + #include <dt-bindings/leds/common.h>
  100. +
  101. + i2c {
  102. + #address-cells = <1>;
  103. + #size-cells = <0>;
  104. +
  105. + led-controller@58 {
  106. + compatible = "st,led1202";
  107. + reg = <0x58>;
  108. + #address-cells = <1>;
  109. + #size-cells = <0>;
  110. +
  111. + led@0 {
  112. + reg = <0x0>;
  113. + function = LED_FUNCTION_STATUS;
  114. + color = <LED_COLOR_ID_RED>;
  115. + function-enumerator = <1>;
  116. + };
  117. +
  118. + led@1 {
  119. + reg = <0x1>;
  120. + function = LED_FUNCTION_STATUS;
  121. + color = <LED_COLOR_ID_GREEN>;
  122. + function-enumerator = <2>;
  123. + };
  124. +
  125. + led@2 {
  126. + reg = <0x2>;
  127. + function = LED_FUNCTION_STATUS;
  128. + color = <LED_COLOR_ID_BLUE>;
  129. + function-enumerator = <3>;
  130. + };
  131. +
  132. + led@3 {
  133. + reg = <0x3>;
  134. + function = LED_FUNCTION_STATUS;
  135. + color = <LED_COLOR_ID_RED>;
  136. + function-enumerator = <4>;
  137. + };
  138. +
  139. + led@4 {
  140. + reg = <0x4>;
  141. + function = LED_FUNCTION_STATUS;
  142. + color = <LED_COLOR_ID_GREEN>;
  143. + function-enumerator = <5>;
  144. + };
  145. +
  146. + led@5 {
  147. + reg = <0x5>;
  148. + function = LED_FUNCTION_STATUS;
  149. + color = <LED_COLOR_ID_BLUE>;
  150. + function-enumerator = <6>;
  151. + };
  152. +
  153. + led@6 {
  154. + reg = <0x6>;
  155. + function = LED_FUNCTION_STATUS;
  156. + color = <LED_COLOR_ID_RED>;
  157. + function-enumerator = <7>;
  158. + };
  159. +
  160. + led@7 {
  161. + reg = <0x7>;
  162. + function = LED_FUNCTION_STATUS;
  163. + color = <LED_COLOR_ID_GREEN>;
  164. + function-enumerator = <8>;
  165. + };
  166. +
  167. + led@8 {
  168. + reg = <0x8>;
  169. + function = LED_FUNCTION_STATUS;
  170. + color = <LED_COLOR_ID_BLUE>;
  171. + function-enumerator = <9>;
  172. + };
  173. + };
  174. + };
  175. +...