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