xref: /freebsd-src/sys/contrib/device-tree/Bindings/leds/leds-qcom-lpg.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2d5b0e70fSEmmanuel Vadot%YAML 1.2
3d5b0e70fSEmmanuel Vadot---
4d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/leds/leds-qcom-lpg.yaml#
5d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6d5b0e70fSEmmanuel Vadot
7d5b0e70fSEmmanuel Vadottitle: Qualcomm Light Pulse Generator
8d5b0e70fSEmmanuel Vadot
9d5b0e70fSEmmanuel Vadotmaintainers:
10d5b0e70fSEmmanuel Vadot  - Bjorn Andersson <bjorn.andersson@linaro.org>
11d5b0e70fSEmmanuel Vadot
12d5b0e70fSEmmanuel Vadotdescription: >
13d5b0e70fSEmmanuel Vadot  The Qualcomm Light Pulse Generator consists of three different hardware blocks;
1401950c46SEmmanuel Vadot  a ramp generator with lookup table (LUT), the light pulse generator and a three
15d5b0e70fSEmmanuel Vadot  channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
16d5b0e70fSEmmanuel Vadot
17d5b0e70fSEmmanuel Vadotproperties:
18d5b0e70fSEmmanuel Vadot  compatible:
19f126890aSEmmanuel Vadot    oneOf:
20f126890aSEmmanuel Vadot      - enum:
21b97ee269SEmmanuel Vadot          - qcom,pm660l-lpg
22d5b0e70fSEmmanuel Vadot          - qcom,pm8150b-lpg
23d5b0e70fSEmmanuel Vadot          - qcom,pm8150l-lpg
24d5b0e70fSEmmanuel Vadot          - qcom,pm8350c-pwm
25d5b0e70fSEmmanuel Vadot          - qcom,pm8916-pwm
26d5b0e70fSEmmanuel Vadot          - qcom,pm8941-lpg
27d5b0e70fSEmmanuel Vadot          - qcom,pm8994-lpg
28d5b0e70fSEmmanuel Vadot          - qcom,pmc8180c-lpg
29f126890aSEmmanuel Vadot          - qcom,pmi632-lpg
30*7d0873ebSEmmanuel Vadot          - qcom,pmi8950-pwm
31d5b0e70fSEmmanuel Vadot          - qcom,pmi8994-lpg
32d5b0e70fSEmmanuel Vadot          - qcom,pmi8998-lpg
33fac71e4eSEmmanuel Vadot          - qcom,pmk8550-pwm
34f126890aSEmmanuel Vadot      - items:
35f126890aSEmmanuel Vadot          - enum:
36*7d0873ebSEmmanuel Vadot              - qcom,pm6150l-lpg
37*7d0873ebSEmmanuel Vadot          - const: qcom,pm8150l-lpg
38*7d0873ebSEmmanuel Vadot      - items:
39*7d0873ebSEmmanuel Vadot          - enum:
40f126890aSEmmanuel Vadot              - qcom,pm8550-pwm
41f126890aSEmmanuel Vadot          - const: qcom,pm8350c-pwm
42d5b0e70fSEmmanuel Vadot
43d5b0e70fSEmmanuel Vadot  "#pwm-cells":
44d5b0e70fSEmmanuel Vadot    const: 2
45d5b0e70fSEmmanuel Vadot
46d5b0e70fSEmmanuel Vadot  "#address-cells":
47d5b0e70fSEmmanuel Vadot    const: 1
48d5b0e70fSEmmanuel Vadot
49d5b0e70fSEmmanuel Vadot  "#size-cells":
50d5b0e70fSEmmanuel Vadot    const: 0
51d5b0e70fSEmmanuel Vadot
52d5b0e70fSEmmanuel Vadot  qcom,power-source:
53d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
54d5b0e70fSEmmanuel Vadot    description:
55d5b0e70fSEmmanuel Vadot      power-source used to drive the output, as defined in the datasheet.
56d5b0e70fSEmmanuel Vadot      Should be specified if the TRILED block is present
57d5b0e70fSEmmanuel Vadot    enum: [0, 1, 3]
58d5b0e70fSEmmanuel Vadot
59d5b0e70fSEmmanuel Vadot  qcom,dtest:
60d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-matrix
61d5b0e70fSEmmanuel Vadot    description: >
62d5b0e70fSEmmanuel Vadot      A list of integer pairs, where each pair represent the dtest line the
63d5b0e70fSEmmanuel Vadot      particular channel should be connected to and the flags denoting how the
64aa1a8ff2SEmmanuel Vadot      value should be outputted, as defined in the datasheet. The number of
65d5b0e70fSEmmanuel Vadot      pairs should be the same as the number of channels.
66d5b0e70fSEmmanuel Vadot    items:
67d5b0e70fSEmmanuel Vadot      items:
68d5b0e70fSEmmanuel Vadot        - description: dtest line to attach
69d5b0e70fSEmmanuel Vadot        - description: flags for the attachment
70d5b0e70fSEmmanuel Vadot
7101950c46SEmmanuel Vadot  nvmem:
7201950c46SEmmanuel Vadot    description: >
7301950c46SEmmanuel Vadot      This property is required for PMICs that supports PPG, which is when a
7401950c46SEmmanuel Vadot      PMIC stores LPG per-channel data and pattern LUT in SDAM modules instead
7501950c46SEmmanuel Vadot      of in a LUT peripheral. For PMICs, such as PM8350C, per-channel data
7601950c46SEmmanuel Vadot      and pattern LUT is separated into 2 SDAM modules. In that case, phandles
7701950c46SEmmanuel Vadot      to both SDAM modules need to be specified.
7801950c46SEmmanuel Vadot    minItems: 1
7901950c46SEmmanuel Vadot    maxItems: 2
8001950c46SEmmanuel Vadot
8101950c46SEmmanuel Vadot  nvmem-names:
8201950c46SEmmanuel Vadot    minItems: 1
8301950c46SEmmanuel Vadot    items:
8401950c46SEmmanuel Vadot      - const: lpg_chan_sdam
8501950c46SEmmanuel Vadot      - const: lut_sdam
8601950c46SEmmanuel Vadot
8701950c46SEmmanuel Vadot  qcom,pbs:
8801950c46SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
8901950c46SEmmanuel Vadot    description: >
9001950c46SEmmanuel Vadot      Phandle of the Qualcomm Programmable Boot Sequencer node (PBS).
9101950c46SEmmanuel Vadot      PBS node is used to trigger LPG pattern sequences for PMICs that support
9201950c46SEmmanuel Vadot      single SDAM PPG.
9301950c46SEmmanuel Vadot
94d5b0e70fSEmmanuel Vadot  multi-led:
95d5b0e70fSEmmanuel Vadot    type: object
96d5b0e70fSEmmanuel Vadot    $ref: leds-class-multicolor.yaml#
97b97ee269SEmmanuel Vadot    unevaluatedProperties: false
98b97ee269SEmmanuel Vadot
99d5b0e70fSEmmanuel Vadot    properties:
100d5b0e70fSEmmanuel Vadot      "#address-cells":
101d5b0e70fSEmmanuel Vadot        const: 1
102d5b0e70fSEmmanuel Vadot
103d5b0e70fSEmmanuel Vadot      "#size-cells":
104d5b0e70fSEmmanuel Vadot        const: 0
105d5b0e70fSEmmanuel Vadot
106d5b0e70fSEmmanuel Vadot    patternProperties:
107d5b0e70fSEmmanuel Vadot      "^led@[0-9a-f]$":
108d5b0e70fSEmmanuel Vadot        type: object
109d5b0e70fSEmmanuel Vadot        $ref: common.yaml#
1108bab661aSEmmanuel Vadot        unevaluatedProperties: false
1118bab661aSEmmanuel Vadot
1128bab661aSEmmanuel Vadot        properties:
1138bab661aSEmmanuel Vadot          reg:
1148bab661aSEmmanuel Vadot            maxItems: 1
1158bab661aSEmmanuel Vadot
1168bab661aSEmmanuel Vadot        required:
1178bab661aSEmmanuel Vadot          - reg
118d5b0e70fSEmmanuel Vadot
119d5b0e70fSEmmanuel VadotpatternProperties:
120d5b0e70fSEmmanuel Vadot  "^led@[0-9a-f]$":
121d5b0e70fSEmmanuel Vadot    type: object
122d5b0e70fSEmmanuel Vadot    $ref: common.yaml#
1238bab661aSEmmanuel Vadot    unevaluatedProperties: false
124d5b0e70fSEmmanuel Vadot
125d5b0e70fSEmmanuel Vadot    properties:
1268bab661aSEmmanuel Vadot      reg:
1278bab661aSEmmanuel Vadot        maxItems: 1
128d5b0e70fSEmmanuel Vadot
129d5b0e70fSEmmanuel Vadot    required:
130d5b0e70fSEmmanuel Vadot      - reg
131d5b0e70fSEmmanuel Vadot
132d5b0e70fSEmmanuel Vadotrequired:
133d5b0e70fSEmmanuel Vadot  - compatible
134d5b0e70fSEmmanuel Vadot
135d5b0e70fSEmmanuel VadotadditionalProperties: false
136d5b0e70fSEmmanuel Vadot
13701950c46SEmmanuel VadotallOf:
13801950c46SEmmanuel Vadot  - if:
13901950c46SEmmanuel Vadot      properties:
14001950c46SEmmanuel Vadot        compatible:
14101950c46SEmmanuel Vadot          contains:
14201950c46SEmmanuel Vadot            enum:
14301950c46SEmmanuel Vadot              - qcom,pm660l-lpg
14401950c46SEmmanuel Vadot              - qcom,pm8150b-lpg
14501950c46SEmmanuel Vadot              - qcom,pm8150l-lpg
14601950c46SEmmanuel Vadot              - qcom,pm8916-pwm
14701950c46SEmmanuel Vadot              - qcom,pm8941-lpg
14801950c46SEmmanuel Vadot              - qcom,pm8994-lpg
14901950c46SEmmanuel Vadot              - qcom,pmc8180c-lpg
150*7d0873ebSEmmanuel Vadot              - qcom,pmi8950-pwm
15101950c46SEmmanuel Vadot              - qcom,pmi8994-lpg
15201950c46SEmmanuel Vadot              - qcom,pmi8998-lpg
15301950c46SEmmanuel Vadot              - qcom,pmk8550-pwm
15401950c46SEmmanuel Vadot    then:
15501950c46SEmmanuel Vadot      properties:
15601950c46SEmmanuel Vadot        nvmem: false
15701950c46SEmmanuel Vadot        nvmem-names: false
15801950c46SEmmanuel Vadot
15901950c46SEmmanuel Vadot  - if:
16001950c46SEmmanuel Vadot      properties:
16101950c46SEmmanuel Vadot        compatible:
16201950c46SEmmanuel Vadot          contains:
16301950c46SEmmanuel Vadot            const: qcom,pmi632-lpg
16401950c46SEmmanuel Vadot    then:
16501950c46SEmmanuel Vadot      properties:
16601950c46SEmmanuel Vadot        nvmem:
16701950c46SEmmanuel Vadot          maxItems: 1
16801950c46SEmmanuel Vadot        nvmem-names:
16901950c46SEmmanuel Vadot          maxItems: 1
17001950c46SEmmanuel Vadot
17101950c46SEmmanuel Vadot  - if:
17201950c46SEmmanuel Vadot      properties:
17301950c46SEmmanuel Vadot        compatible:
17401950c46SEmmanuel Vadot          contains:
17501950c46SEmmanuel Vadot            enum:
17601950c46SEmmanuel Vadot              - qcom,pm8350c-pwm
17701950c46SEmmanuel Vadot    then:
17801950c46SEmmanuel Vadot      properties:
17901950c46SEmmanuel Vadot        nvmem:
18001950c46SEmmanuel Vadot          minItems: 2
18101950c46SEmmanuel Vadot        nvmem-names:
18201950c46SEmmanuel Vadot          minItems: 2
18301950c46SEmmanuel Vadot
184d5b0e70fSEmmanuel Vadotexamples:
185d5b0e70fSEmmanuel Vadot  - |
186d5b0e70fSEmmanuel Vadot    #include <dt-bindings/leds/common.h>
187d5b0e70fSEmmanuel Vadot
188d5b0e70fSEmmanuel Vadot    led-controller {
189d5b0e70fSEmmanuel Vadot      compatible = "qcom,pmi8994-lpg";
190d5b0e70fSEmmanuel Vadot
191d5b0e70fSEmmanuel Vadot      #address-cells = <1>;
192d5b0e70fSEmmanuel Vadot      #size-cells = <0>;
193d5b0e70fSEmmanuel Vadot
194d5b0e70fSEmmanuel Vadot      qcom,power-source = <1>;
195d5b0e70fSEmmanuel Vadot
196d5b0e70fSEmmanuel Vadot      qcom,dtest = <0 0>,
197d5b0e70fSEmmanuel Vadot                   <0 0>,
198d5b0e70fSEmmanuel Vadot                   <0 0>,
199d5b0e70fSEmmanuel Vadot                   <4 1>;
200d5b0e70fSEmmanuel Vadot
201d5b0e70fSEmmanuel Vadot      led@1 {
202d5b0e70fSEmmanuel Vadot        reg = <1>;
203d5b0e70fSEmmanuel Vadot        color = <LED_COLOR_ID_GREEN>;
204d5b0e70fSEmmanuel Vadot        function = LED_FUNCTION_INDICATOR;
205d5b0e70fSEmmanuel Vadot        function-enumerator = <1>;
206d5b0e70fSEmmanuel Vadot      };
207d5b0e70fSEmmanuel Vadot
208d5b0e70fSEmmanuel Vadot      led@2 {
209d5b0e70fSEmmanuel Vadot        reg = <2>;
210d5b0e70fSEmmanuel Vadot        color = <LED_COLOR_ID_GREEN>;
211d5b0e70fSEmmanuel Vadot        function = LED_FUNCTION_INDICATOR;
212d5b0e70fSEmmanuel Vadot        function-enumerator = <0>;
213d5b0e70fSEmmanuel Vadot        default-state = "on";
214d5b0e70fSEmmanuel Vadot      };
215d5b0e70fSEmmanuel Vadot
216d5b0e70fSEmmanuel Vadot      led@3 {
217d5b0e70fSEmmanuel Vadot        reg = <3>;
218d5b0e70fSEmmanuel Vadot        color = <LED_COLOR_ID_GREEN>;
219d5b0e70fSEmmanuel Vadot        function = LED_FUNCTION_INDICATOR;
220d5b0e70fSEmmanuel Vadot        function-enumerator = <2>;
221d5b0e70fSEmmanuel Vadot      };
222d5b0e70fSEmmanuel Vadot
223d5b0e70fSEmmanuel Vadot      led@4 {
224d5b0e70fSEmmanuel Vadot        reg = <4>;
225d5b0e70fSEmmanuel Vadot        color = <LED_COLOR_ID_GREEN>;
226d5b0e70fSEmmanuel Vadot        function = LED_FUNCTION_INDICATOR;
227d5b0e70fSEmmanuel Vadot        function-enumerator = <3>;
228d5b0e70fSEmmanuel Vadot      };
229d5b0e70fSEmmanuel Vadot    };
230d5b0e70fSEmmanuel Vadot  - |
231d5b0e70fSEmmanuel Vadot    #include <dt-bindings/leds/common.h>
232d5b0e70fSEmmanuel Vadot
233d5b0e70fSEmmanuel Vadot    led-controller {
234d5b0e70fSEmmanuel Vadot      compatible = "qcom,pmi8994-lpg";
235d5b0e70fSEmmanuel Vadot
236d5b0e70fSEmmanuel Vadot      #address-cells = <1>;
237d5b0e70fSEmmanuel Vadot      #size-cells = <0>;
238d5b0e70fSEmmanuel Vadot
239d5b0e70fSEmmanuel Vadot      qcom,power-source = <1>;
240d5b0e70fSEmmanuel Vadot
241d5b0e70fSEmmanuel Vadot      multi-led {
242d5b0e70fSEmmanuel Vadot        color = <LED_COLOR_ID_RGB>;
243d5b0e70fSEmmanuel Vadot        function = LED_FUNCTION_STATUS;
244d5b0e70fSEmmanuel Vadot
245d5b0e70fSEmmanuel Vadot        #address-cells = <1>;
246d5b0e70fSEmmanuel Vadot        #size-cells = <0>;
247d5b0e70fSEmmanuel Vadot
248d5b0e70fSEmmanuel Vadot        led@1 {
249d5b0e70fSEmmanuel Vadot          reg = <1>;
250d5b0e70fSEmmanuel Vadot          color = <LED_COLOR_ID_RED>;
251d5b0e70fSEmmanuel Vadot        };
252d5b0e70fSEmmanuel Vadot
253d5b0e70fSEmmanuel Vadot        led@2 {
254d5b0e70fSEmmanuel Vadot          reg = <2>;
255d5b0e70fSEmmanuel Vadot          color = <LED_COLOR_ID_GREEN>;
256d5b0e70fSEmmanuel Vadot        };
257d5b0e70fSEmmanuel Vadot
258d5b0e70fSEmmanuel Vadot        led@3 {
259d5b0e70fSEmmanuel Vadot          reg = <3>;
260d5b0e70fSEmmanuel Vadot          color = <LED_COLOR_ID_BLUE>;
261d5b0e70fSEmmanuel Vadot        };
262d5b0e70fSEmmanuel Vadot      };
263d5b0e70fSEmmanuel Vadot    };
264d5b0e70fSEmmanuel Vadot  - |
265d5b0e70fSEmmanuel Vadot    pwm-controller {
266d5b0e70fSEmmanuel Vadot      compatible = "qcom,pm8916-pwm";
267d5b0e70fSEmmanuel Vadot      #pwm-cells = <2>;
268d5b0e70fSEmmanuel Vadot    };
26901950c46SEmmanuel Vadot  - |
27001950c46SEmmanuel Vadot    #include <dt-bindings/leds/common.h>
27101950c46SEmmanuel Vadot
27201950c46SEmmanuel Vadot    led-controller {
27301950c46SEmmanuel Vadot      compatible = "qcom,pmi632-lpg";
27401950c46SEmmanuel Vadot      #address-cells = <1>;
27501950c46SEmmanuel Vadot      #size-cells = <0>;
27601950c46SEmmanuel Vadot      #pwm-cells = <2>;
27701950c46SEmmanuel Vadot      nvmem-names = "lpg_chan_sdam";
27801950c46SEmmanuel Vadot      nvmem = <&pmi632_sdam_7>;
27901950c46SEmmanuel Vadot      qcom,pbs = <&pmi632_pbs_client3>;
28001950c46SEmmanuel Vadot
28101950c46SEmmanuel Vadot      led@1 {
28201950c46SEmmanuel Vadot        reg = <1>;
28301950c46SEmmanuel Vadot        color = <LED_COLOR_ID_RED>;
28401950c46SEmmanuel Vadot        label = "red";
28501950c46SEmmanuel Vadot      };
28601950c46SEmmanuel Vadot
28701950c46SEmmanuel Vadot      led@2 {
28801950c46SEmmanuel Vadot        reg = <2>;
28901950c46SEmmanuel Vadot        color = <LED_COLOR_ID_GREEN>;
29001950c46SEmmanuel Vadot        label = "green";
29101950c46SEmmanuel Vadot      };
29201950c46SEmmanuel Vadot
29301950c46SEmmanuel Vadot      led@3 {
29401950c46SEmmanuel Vadot        reg = <3>;
29501950c46SEmmanuel Vadot        color = <LED_COLOR_ID_BLUE>;
29601950c46SEmmanuel Vadot        label = "blue";
29701950c46SEmmanuel Vadot      };
29801950c46SEmmanuel Vadot    };
299