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
76patternProperties:
77  "^led@[0-9a-f]$":
78    type: object
79    $ref: common.yaml#
80
81    properties:
82      reg: true
83
84    required:
85      - reg
86
87required:
88  - compatible
89
90additionalProperties: false
91
92examples:
93  - |
94    #include <dt-bindings/leds/common.h>
95
96    led-controller {
97      compatible = "qcom,pmi8994-lpg";
98
99      #address-cells = <1>;
100      #size-cells = <0>;
101
102      qcom,power-source = <1>;
103
104      qcom,dtest = <0 0>,
105                   <0 0>,
106                   <0 0>,
107                   <4 1>;
108
109      led@1 {
110        reg = <1>;
111        color = <LED_COLOR_ID_GREEN>;
112        function = LED_FUNCTION_INDICATOR;
113        function-enumerator = <1>;
114      };
115
116      led@2 {
117        reg = <2>;
118        color = <LED_COLOR_ID_GREEN>;
119        function = LED_FUNCTION_INDICATOR;
120        function-enumerator = <0>;
121        default-state = "on";
122      };
123
124      led@3 {
125        reg = <3>;
126        color = <LED_COLOR_ID_GREEN>;
127        function = LED_FUNCTION_INDICATOR;
128        function-enumerator = <2>;
129      };
130
131      led@4 {
132        reg = <4>;
133        color = <LED_COLOR_ID_GREEN>;
134        function = LED_FUNCTION_INDICATOR;
135        function-enumerator = <3>;
136      };
137    };
138  - |
139    #include <dt-bindings/leds/common.h>
140
141    led-controller {
142      compatible = "qcom,pmi8994-lpg";
143
144      #address-cells = <1>;
145      #size-cells = <0>;
146
147      qcom,power-source = <1>;
148
149      multi-led {
150        color = <LED_COLOR_ID_RGB>;
151        function = LED_FUNCTION_STATUS;
152
153        #address-cells = <1>;
154        #size-cells = <0>;
155
156        led@1 {
157          reg = <1>;
158          color = <LED_COLOR_ID_RED>;
159        };
160
161        led@2 {
162          reg = <2>;
163          color = <LED_COLOR_ID_GREEN>;
164        };
165
166        led@3 {
167          reg = <3>;
168          color = <LED_COLOR_ID_BLUE>;
169        };
170      };
171    };
172  - |
173    pwm-controller {
174      compatible = "qcom,pm8916-pwm";
175      #pwm-cells = <2>;
176    };
177...
178