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