qcom-wled.yaml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/backlight/qcom-wled.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Qualcomm Technologies, Inc. WLED driver
  7. maintainers:
  8. - Bjorn Andersson <andersson@kernel.org>
  9. - Kiran Gunda <quic_kgunda@quicinc.com>
  10. description: |
  11. WLED (White Light Emitting Diode) driver is used for controlling display
  12. backlight that is part of PMIC on Qualcomm Technologies, Inc. reference
  13. platforms. The PMIC is connected to the host processor via SPMI bus.
  14. properties:
  15. compatible:
  16. enum:
  17. - qcom,pm8941-wled
  18. - qcom,pmi8950-wled
  19. - qcom,pmi8994-wled
  20. - qcom,pmi8998-wled
  21. - qcom,pm660l-wled
  22. - qcom,pm6150l-wled
  23. - qcom,pm8150l-wled
  24. reg:
  25. minItems: 1
  26. maxItems: 2
  27. default-brightness:
  28. description: |
  29. brightness value on boot.
  30. label: true
  31. max-brightness:
  32. description: |
  33. Maximum brightness level.
  34. qcom,cs-out:
  35. description: |
  36. enable current sink output.
  37. This property is supported only for WLED3.
  38. type: boolean
  39. qcom,cabc:
  40. description: |
  41. enable content adaptive backlight control.
  42. type: boolean
  43. qcom,ext-gen:
  44. description: |
  45. use externally generated modulator signal to dim.
  46. This property is supported only for WLED3.
  47. type: boolean
  48. qcom,current-limit:
  49. description: |
  50. mA; per-string current limit.
  51. This property is supported only for WLED3.
  52. $ref: /schemas/types.yaml#/definitions/uint32
  53. default: 20
  54. minimum: 0
  55. maximum: 25
  56. qcom,current-limit-microamp:
  57. description: |
  58. uA; per-string current limit.
  59. default: 25
  60. minimum: 0
  61. maximum: 30000
  62. multipleOf: 25
  63. qcom,current-boost-limit:
  64. description: |
  65. mA; boost current limit.
  66. $ref: /schemas/types.yaml#/definitions/uint32
  67. qcom,switching-freq:
  68. description: |
  69. kHz; switching frequency.
  70. $ref: /schemas/types.yaml#/definitions/uint32
  71. enum: [ 600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371, 1600, 1920,
  72. 2400, 3200, 4800, 9600 ]
  73. qcom,ovp:
  74. description: |
  75. V; Over-voltage protection limit.
  76. This property is supported only for WLED3.
  77. $ref: /schemas/types.yaml#/definitions/uint32
  78. enum: [ 27, 29, 32, 35 ]
  79. default: 29
  80. qcom,ovp-millivolt:
  81. description: |
  82. Over-voltage protection limit. This property is for WLED4 only.
  83. $ref: /schemas/types.yaml#/definitions/uint32
  84. minimum: 17800
  85. maximum: 31100
  86. qcom,num-strings:
  87. description: |
  88. number of led strings attached.
  89. $ref: /schemas/types.yaml#/definitions/uint32
  90. qcom,enabled-strings:
  91. description: |
  92. Array of the WLED strings numbered from 0 to 3. Each
  93. string of leds are operated individually. Specify the
  94. list of strings used by the device. Any combination of
  95. led strings can be used.
  96. $ref: /schemas/types.yaml#/definitions/uint32-array
  97. minItems: 1
  98. maxItems: 4
  99. qcom,external-pfet:
  100. description: |
  101. Specify if external PFET control for short circuit
  102. protection is used. This property is supported only
  103. for WLED4.
  104. type: boolean
  105. qcom,auto-string-detection:
  106. description: |
  107. Enables auto-detection of the WLED string configuration.
  108. This feature is not supported for WLED3.
  109. type: boolean
  110. interrupts:
  111. minItems: 1
  112. items:
  113. - description: over voltage protection interrupt.
  114. - description: short circuit interrupt.
  115. interrupt-names:
  116. minItems: 1
  117. items:
  118. - const: ovp
  119. - const: short
  120. qcom,modulator-sel:
  121. description: |
  122. Selects the modulator used for brightness modulation.
  123. Allowed values are,
  124. 0 - Modulator A
  125. 1 - Modulator B
  126. This property is applicable only to WLED5 peripheral.
  127. $ref: /schemas/types.yaml#/definitions/uint32
  128. enum: [ 0, 1 ]
  129. default: 0
  130. qcom,cabc-sel:
  131. description: |
  132. Selects the CABC pin signal used for brightness modulation.
  133. Allowed values are,
  134. 0 - CABC disabled
  135. 1 - CABC 1
  136. 2 - CABC 2
  137. 3 - External signal (e.g. LPG) is used for dimming
  138. This property is applicable only to WLED5 peripheral.
  139. $ref: /schemas/types.yaml#/definitions/uint32
  140. enum: [ 0, 1, 2, 3 ]
  141. allOf:
  142. - if:
  143. properties:
  144. compatible:
  145. contains:
  146. const: qcom,pm8941-wled
  147. then:
  148. properties:
  149. reg:
  150. maxItems: 1
  151. qcom,current-boost-limit:
  152. enum: [ 105, 385, 525, 805, 980, 1260, 1400, 1680 ]
  153. default: 805
  154. qcom,switching-freq:
  155. default: 1600
  156. qcom,num-strings:
  157. enum: [ 1, 2, 3 ]
  158. interrupts:
  159. maxItems: 1
  160. interrupt-names:
  161. maxItems: 1
  162. else:
  163. properties:
  164. reg:
  165. minItems: 2
  166. qcom,current-boost-limit:
  167. enum: [ 105, 280, 450, 620, 970, 1150, 1300, 1500 ]
  168. default: 970
  169. qcom,switching-freq:
  170. default: 800
  171. qcom,num-strings:
  172. enum: [ 1, 2, 3, 4 ]
  173. interrupts:
  174. minItems: 2
  175. interrupt-names:
  176. minItems: 2
  177. - if:
  178. properties:
  179. compatible:
  180. contains:
  181. enum:
  182. - qcom,pm8150l-wled
  183. then:
  184. properties:
  185. default-brightness:
  186. minimum: 0
  187. maximum: 32767
  188. max-brightness:
  189. minimum: 0
  190. maximum: 32767
  191. else:
  192. properties:
  193. default-brightness:
  194. minimum: 0
  195. maximum: 4095
  196. max-brightness:
  197. minimum: 0
  198. maximum: 4095
  199. - if:
  200. properties:
  201. compatible:
  202. contains:
  203. enum:
  204. - qcom,pmi8950-wled
  205. - qcom,pmi8994-wled
  206. then:
  207. properties:
  208. qcom,ovp-millivolt:
  209. enum: [ 17800, 19400, 29500, 31000 ]
  210. default: 29500
  211. else:
  212. properties:
  213. qcom,ovp-millivolt:
  214. enum: [ 18100, 19600, 29600, 31100 ]
  215. default: 29600
  216. required:
  217. - compatible
  218. - reg
  219. - label
  220. additionalProperties: false
  221. examples:
  222. - |
  223. backlight@d800 {
  224. compatible = "qcom,pm8941-wled";
  225. reg = <0xd800 0x100>;
  226. label = "backlight";
  227. qcom,cs-out;
  228. qcom,current-limit = <20>;
  229. qcom,current-boost-limit = <805>;
  230. qcom,switching-freq = <1600>;
  231. qcom,ovp = <29>;
  232. qcom,num-strings = <2>;
  233. qcom,enabled-strings = <0 1>;
  234. };