1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/leds-qcom-lpg.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm Light Pulse Generator
8
9maintainers:
10  - Bjorn Andersson <bjorn.andersson@linaro.org>
11
12description: >
13  The Qualcomm Light Pulse Generator consists of three different hardware blocks;
14  a ramp generator with lookup table, the light pulse generator and a three
15  channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
16
17properties:
18  compatible:
19    enum:
20      - qcom,pm660l-lpg
21      - qcom,pm8150b-lpg
22      - qcom,pm8150l-lpg
23      - qcom,pm8350c-pwm
24      - qcom,pm8916-pwm
25      - qcom,pm8941-lpg
26      - qcom,pm8994-lpg
27      - qcom,pmc8180c-lpg
28      - qcom,pmi8994-lpg
29      - qcom,pmi8998-lpg
30
31  "#pwm-cells":
32    const: 2
33
34  "#address-cells":
35    const: 1
36
37  "#size-cells":
38    const: 0
39
40  qcom,power-source:
41    $ref: /schemas/types.yaml#/definitions/uint32
42    description:
43      power-source used to drive the output, as defined in the datasheet.
44      Should be specified if the TRILED block is present
45    enum: [0, 1, 3]
46
47  qcom,dtest:
48    $ref: /schemas/types.yaml#/definitions/uint32-matrix
49    description: >
50      A list of integer pairs, where each pair represent the dtest line the
51      particular channel should be connected to and the flags denoting how the
52      value should be outputed, as defined in the datasheet. The number of
53      pairs should be the same as the number of channels.
54    items:
55      items:
56        - description: dtest line to attach
57        - description: flags for the attachment
58
59  multi-led:
60    type: object
61    $ref: leds-class-multicolor.yaml#
62    unevaluatedProperties: false
63
64    properties:
65      "#address-cells":
66        const: 1
67
68      "#size-cells":
69        const: 0
70
71    patternProperties:
72      "^led@[0-9a-f]$":
73        type: object
74        $ref: common.yaml#
75        unevaluatedProperties: false
76
77        properties:
78          reg:
79            maxItems: 1
80
81        required:
82          - reg
83
84patternProperties:
85  "^led@[0-9a-f]$":
86    type: object
87    $ref: common.yaml#
88    unevaluatedProperties: false
89
90    properties:
91      reg:
92        maxItems: 1
93
94    required:
95      - reg
96
97required:
98  - compatible
99
100additionalProperties: false
101
102examples:
103  - |
104    #include <dt-bindings/leds/common.h>
105
106    led-controller {
107      compatible = "qcom,pmi8994-lpg";
108
109      #address-cells = <1>;
110      #size-cells = <0>;
111
112      qcom,power-source = <1>;
113
114      qcom,dtest = <0 0>,
115                   <0 0>,
116                   <0 0>,
117                   <4 1>;
118
119      led@1 {
120        reg = <1>;
121        color = <LED_COLOR_ID_GREEN>;
122        function = LED_FUNCTION_INDICATOR;
123        function-enumerator = <1>;
124      };
125
126      led@2 {
127        reg = <2>;
128        color = <LED_COLOR_ID_GREEN>;
129        function = LED_FUNCTION_INDICATOR;
130        function-enumerator = <0>;
131        default-state = "on";
132      };
133
134      led@3 {
135        reg = <3>;
136        color = <LED_COLOR_ID_GREEN>;
137        function = LED_FUNCTION_INDICATOR;
138        function-enumerator = <2>;
139      };
140
141      led@4 {
142        reg = <4>;
143        color = <LED_COLOR_ID_GREEN>;
144        function = LED_FUNCTION_INDICATOR;
145        function-enumerator = <3>;
146      };
147    };
148  - |
149    #include <dt-bindings/leds/common.h>
150
151    led-controller {
152      compatible = "qcom,pmi8994-lpg";
153
154      #address-cells = <1>;
155      #size-cells = <0>;
156
157      qcom,power-source = <1>;
158
159      multi-led {
160        color = <LED_COLOR_ID_RGB>;
161        function = LED_FUNCTION_STATUS;
162
163        #address-cells = <1>;
164        #size-cells = <0>;
165
166        led@1 {
167          reg = <1>;
168          color = <LED_COLOR_ID_RED>;
169        };
170
171        led@2 {
172          reg = <2>;
173          color = <LED_COLOR_ID_GREEN>;
174        };
175
176        led@3 {
177          reg = <3>;
178          color = <LED_COLOR_ID_BLUE>;
179        };
180      };
181    };
182  - |
183    pwm-controller {
184      compatible = "qcom,pm8916-pwm";
185      #pwm-cells = <2>;
186    };
187...
188