0054-dt-bindings-leds-Add-Allwinner-A100-LED-controller.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. From 31857adcc9db7244a047a3a3550219f7559d8846 Mon Sep 17 00:00:00 2001
  2. From: Samuel Holland <[email protected]>
  3. Date: Wed, 4 Aug 2021 21:36:26 -0500
  4. Subject: [PATCH 054/117] dt-bindings: leds: Add Allwinner A100 LED controller
  5. The Allwinner A100, R329, and D1 SoCs contain an LED controller designed
  6. to drive a series of RGB LED pixels. It supports PIO and DMA transfers,
  7. and has configurable timing and pixel format. All three implementations
  8. appear to be identical, so use the oldest as the fallback compatible.
  9. Series-changes: 2
  10. - Fixed typo leading to duplicate t1h-ns property
  11. - Removed "items" layer in definition of dmas/dma-names
  12. - Replaced uint32 type reference with maxItems in timing properties
  13. Series-changes: 3
  14. - Removed quotes from enumeration values
  15. - Added vendor prefix to timing/format properties
  16. - Renamed "format" property to "pixel-format" for clarity
  17. - Dropped "vled-supply" as it is unrelated to the controller hardware
  18. Series-changes: 4
  19. - Use "default" instead of "maxItems" for timing properties
  20. Series-changes: 5
  21. - A100 contains the original implementation, so use that as the base
  22. compatible string, and rename the binding to match
  23. - Add "unevaluatedProperties: false" to the child multi-led binding
  24. Acked-by: Maxime Ripard <[email protected]>
  25. Reviewed-by: Rob Herring <[email protected]>
  26. Signed-off-by: Samuel Holland <[email protected]>
  27. ---
  28. .../leds/allwinner,sun50i-a100-ledc.yaml | 139 ++++++++++++++++++
  29. 1 file changed, 139 insertions(+)
  30. create mode 100644 Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml
  31. --- /dev/null
  32. +++ b/Documentation/devicetree/bindings/leds/allwinner,sun50i-a100-ledc.yaml
  33. @@ -0,0 +1,139 @@
  34. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  35. +%YAML 1.2
  36. +---
  37. +$id: http://devicetree.org/schemas/leds/allwinner,sun50i-a100-ledc.yaml#
  38. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  39. +
  40. +title: Allwinner A100 LED Controller Bindings
  41. +
  42. +maintainers:
  43. + - Samuel Holland <[email protected]>
  44. +
  45. +description:
  46. + The LED controller found in Allwinner sunxi SoCs uses a one-wire serial
  47. + interface to drive up to 1024 RGB LEDs.
  48. +
  49. +properties:
  50. + compatible:
  51. + oneOf:
  52. + - const: allwinner,sun50i-a100-ledc
  53. + - items:
  54. + - enum:
  55. + - allwinner,sun20i-d1-ledc
  56. + - allwinner,sun50i-r329-ledc
  57. + - const: allwinner,sun50i-a100-ledc
  58. +
  59. + reg:
  60. + maxItems: 1
  61. +
  62. + "#address-cells":
  63. + const: 1
  64. +
  65. + "#size-cells":
  66. + const: 0
  67. +
  68. + interrupts:
  69. + maxItems: 1
  70. +
  71. + clocks:
  72. + items:
  73. + - description: Bus clock
  74. + - description: Module clock
  75. +
  76. + clock-names:
  77. + items:
  78. + - const: bus
  79. + - const: mod
  80. +
  81. + resets:
  82. + maxItems: 1
  83. +
  84. + dmas:
  85. + maxItems: 1
  86. + description: TX DMA channel
  87. +
  88. + dma-names:
  89. + const: tx
  90. +
  91. + allwinner,pixel-format:
  92. + description: Pixel format (subpixel transmission order), default is "grb"
  93. + enum:
  94. + - bgr
  95. + - brg
  96. + - gbr
  97. + - grb
  98. + - rbg
  99. + - rgb
  100. +
  101. + allwinner,t0h-ns:
  102. + default: 336
  103. + description: Length of high pulse when transmitting a "0" bit
  104. +
  105. + allwinner,t0l-ns:
  106. + default: 840
  107. + description: Length of low pulse when transmitting a "0" bit
  108. +
  109. + allwinner,t1h-ns:
  110. + default: 882
  111. + description: Length of high pulse when transmitting a "1" bit
  112. +
  113. + allwinner,t1l-ns:
  114. + default: 294
  115. + description: Length of low pulse when transmitting a "1" bit
  116. +
  117. + allwinner,treset-ns:
  118. + default: 300000
  119. + description: Minimum delay between transmission frames
  120. +
  121. +patternProperties:
  122. + "^multi-led@[0-9a-f]+$":
  123. + type: object
  124. + $ref: leds-class-multicolor.yaml#
  125. + unevaluatedProperties: false
  126. + properties:
  127. + reg:
  128. + minimum: 0
  129. + maximum: 1023
  130. + description: Index of the LED in the series (must be contiguous)
  131. +
  132. + required:
  133. + - reg
  134. +
  135. +required:
  136. + - compatible
  137. + - reg
  138. + - interrupts
  139. + - clocks
  140. + - clock-names
  141. + - resets
  142. + - dmas
  143. + - dma-names
  144. +
  145. +additionalProperties: false
  146. +
  147. +examples:
  148. + - |
  149. + #include <dt-bindings/interrupt-controller/irq.h>
  150. + #include <dt-bindings/leds/common.h>
  151. +
  152. + ledc: led-controller@2008000 {
  153. + compatible = "allwinner,sun20i-d1-ledc",
  154. + "allwinner,sun50i-a100-ledc";
  155. + reg = <0x2008000 0x400>;
  156. + interrupts = <36 IRQ_TYPE_LEVEL_HIGH>;
  157. + clocks = <&ccu 12>, <&ccu 34>;
  158. + clock-names = "bus", "mod";
  159. + resets = <&ccu 12>;
  160. + dmas = <&dma 42>;
  161. + dma-names = "tx";
  162. + #address-cells = <1>;
  163. + #size-cells = <0>;
  164. +
  165. + multi-led@0 {
  166. + reg = <0x0>;
  167. + color = <LED_COLOR_ID_RGB>;
  168. + function = LED_FUNCTION_INDICATOR;
  169. + };
  170. + };
  171. +
  172. +...