leds-qcom-lpg.yaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/leds-qcom-lpg.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Qualcomm Light Pulse Generator
  7. maintainers:
  8. - Bjorn Andersson <bjorn.andersson@linaro.org>
  9. description: >
  10. The Qualcomm Light Pulse Generator consists of three different hardware blocks;
  11. a ramp generator with lookup table (LUT), the light pulse generator and a three
  12. channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
  13. properties:
  14. compatible:
  15. oneOf:
  16. - enum:
  17. - qcom,pm660l-lpg
  18. - qcom,pm8150b-lpg
  19. - qcom,pm8150l-lpg
  20. - qcom,pm8350c-pwm
  21. - qcom,pm8916-pwm
  22. - qcom,pm8941-lpg
  23. - qcom,pm8994-lpg
  24. - qcom,pmc8180c-lpg
  25. - qcom,pmi632-lpg
  26. - qcom,pmi8950-pwm
  27. - qcom,pmi8994-lpg
  28. - qcom,pmi8998-lpg
  29. - qcom,pmk8550-pwm
  30. - items:
  31. - enum:
  32. - qcom,pm6150l-lpg
  33. - const: qcom,pm8150l-lpg
  34. - items:
  35. - enum:
  36. - qcom,pm8550-pwm
  37. - const: qcom,pm8350c-pwm
  38. "#pwm-cells":
  39. const: 2
  40. "#address-cells":
  41. const: 1
  42. "#size-cells":
  43. const: 0
  44. qcom,power-source:
  45. $ref: /schemas/types.yaml#/definitions/uint32
  46. description:
  47. power-source used to drive the output, as defined in the datasheet.
  48. Should be specified if the TRILED block is present
  49. enum: [0, 1, 3]
  50. qcom,dtest:
  51. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  52. description: >
  53. A list of integer pairs, where each pair represent the dtest line the
  54. particular channel should be connected to and the flags denoting how the
  55. value should be outputted, as defined in the datasheet. The number of
  56. pairs should be the same as the number of channels.
  57. items:
  58. items:
  59. - description: dtest line to attach
  60. - description: flags for the attachment
  61. nvmem:
  62. description: >
  63. This property is required for PMICs that supports PPG, which is when a
  64. PMIC stores LPG per-channel data and pattern LUT in SDAM modules instead
  65. of in a LUT peripheral. For PMICs, such as PM8350C, per-channel data
  66. and pattern LUT is separated into 2 SDAM modules. In that case, phandles
  67. to both SDAM modules need to be specified.
  68. minItems: 1
  69. maxItems: 2
  70. nvmem-names:
  71. minItems: 1
  72. items:
  73. - const: lpg_chan_sdam
  74. - const: lut_sdam
  75. qcom,pbs:
  76. $ref: /schemas/types.yaml#/definitions/phandle
  77. description: >
  78. Phandle of the Qualcomm Programmable Boot Sequencer node (PBS).
  79. PBS node is used to trigger LPG pattern sequences for PMICs that support
  80. single SDAM PPG.
  81. multi-led:
  82. type: object
  83. $ref: leds-class-multicolor.yaml#
  84. unevaluatedProperties: false
  85. properties:
  86. "#address-cells":
  87. const: 1
  88. "#size-cells":
  89. const: 0
  90. patternProperties:
  91. "^led@[0-9a-f]$":
  92. type: object
  93. $ref: common.yaml#
  94. unevaluatedProperties: false
  95. properties:
  96. reg:
  97. maxItems: 1
  98. required:
  99. - reg
  100. patternProperties:
  101. "^led@[0-9a-f]$":
  102. type: object
  103. $ref: common.yaml#
  104. unevaluatedProperties: false
  105. properties:
  106. reg:
  107. maxItems: 1
  108. required:
  109. - reg
  110. required:
  111. - compatible
  112. additionalProperties: false
  113. allOf:
  114. - if:
  115. properties:
  116. compatible:
  117. contains:
  118. enum:
  119. - qcom,pm660l-lpg
  120. - qcom,pm8150b-lpg
  121. - qcom,pm8150l-lpg
  122. - qcom,pm8916-pwm
  123. - qcom,pm8941-lpg
  124. - qcom,pm8994-lpg
  125. - qcom,pmc8180c-lpg
  126. - qcom,pmi8950-pwm
  127. - qcom,pmi8994-lpg
  128. - qcom,pmi8998-lpg
  129. - qcom,pmk8550-pwm
  130. then:
  131. properties:
  132. nvmem: false
  133. nvmem-names: false
  134. - if:
  135. properties:
  136. compatible:
  137. contains:
  138. const: qcom,pmi632-lpg
  139. then:
  140. properties:
  141. nvmem:
  142. maxItems: 1
  143. nvmem-names:
  144. maxItems: 1
  145. - if:
  146. properties:
  147. compatible:
  148. contains:
  149. enum:
  150. - qcom,pm8350c-pwm
  151. then:
  152. properties:
  153. nvmem:
  154. minItems: 2
  155. nvmem-names:
  156. minItems: 2
  157. examples:
  158. - |
  159. #include <dt-bindings/leds/common.h>
  160. led-controller {
  161. compatible = "qcom,pmi8994-lpg";
  162. #address-cells = <1>;
  163. #size-cells = <0>;
  164. qcom,power-source = <1>;
  165. qcom,dtest = <0 0>,
  166. <0 0>,
  167. <0 0>,
  168. <4 1>;
  169. led@1 {
  170. reg = <1>;
  171. color = <LED_COLOR_ID_GREEN>;
  172. function = LED_FUNCTION_INDICATOR;
  173. function-enumerator = <1>;
  174. };
  175. led@2 {
  176. reg = <2>;
  177. color = <LED_COLOR_ID_GREEN>;
  178. function = LED_FUNCTION_INDICATOR;
  179. function-enumerator = <0>;
  180. default-state = "on";
  181. };
  182. led@3 {
  183. reg = <3>;
  184. color = <LED_COLOR_ID_GREEN>;
  185. function = LED_FUNCTION_INDICATOR;
  186. function-enumerator = <2>;
  187. };
  188. led@4 {
  189. reg = <4>;
  190. color = <LED_COLOR_ID_GREEN>;
  191. function = LED_FUNCTION_INDICATOR;
  192. function-enumerator = <3>;
  193. };
  194. };
  195. - |
  196. #include <dt-bindings/leds/common.h>
  197. led-controller {
  198. compatible = "qcom,pmi8994-lpg";
  199. #address-cells = <1>;
  200. #size-cells = <0>;
  201. qcom,power-source = <1>;
  202. multi-led {
  203. color = <LED_COLOR_ID_RGB>;
  204. function = LED_FUNCTION_STATUS;
  205. #address-cells = <1>;
  206. #size-cells = <0>;
  207. led@1 {
  208. reg = <1>;
  209. color = <LED_COLOR_ID_RED>;
  210. };
  211. led@2 {
  212. reg = <2>;
  213. color = <LED_COLOR_ID_GREEN>;
  214. };
  215. led@3 {
  216. reg = <3>;
  217. color = <LED_COLOR_ID_BLUE>;
  218. };
  219. };
  220. };
  221. - |
  222. pwm-controller {
  223. compatible = "qcom,pm8916-pwm";
  224. #pwm-cells = <2>;
  225. };
  226. - |
  227. #include <dt-bindings/leds/common.h>
  228. led-controller {
  229. compatible = "qcom,pmi632-lpg";
  230. #address-cells = <1>;
  231. #size-cells = <0>;
  232. #pwm-cells = <2>;
  233. nvmem-names = "lpg_chan_sdam";
  234. nvmem = <&pmi632_sdam_7>;
  235. qcom,pbs = <&pmi632_pbs_client3>;
  236. led@1 {
  237. reg = <1>;
  238. color = <LED_COLOR_ID_RED>;
  239. label = "red";
  240. };
  241. led@2 {
  242. reg = <2>;
  243. color = <LED_COLOR_ID_GREEN>;
  244. label = "green";
  245. };
  246. led@3 {
  247. reg = <3>;
  248. color = <LED_COLOR_ID_BLUE>;
  249. label = "blue";
  250. };
  251. };