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