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