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