leds-qcom-lpg.yaml 7.1 KB

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