1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/qcom,spmi-flash-led.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Flash LED device inside Qualcomm Technologies, Inc. PMICs
8
9maintainers:
10  - Fenglin Wu <quic_fenglinw@quicinc.com>
11
12description: |
13  Flash LED controller is present inside some Qualcomm Technologies, Inc. PMICs.
14  The flash LED module can have different number of LED channels supported
15  e.g. 3 or 4. There are some different registers between them but they can
16  both support maximum current up to 1.5 A per channel and they can also support
17  ganging 2 channels together to supply maximum current up to 2 A. The current
18  will be split symmetrically on each channel and they will be enabled and
19  disabled at the same time.
20
21properties:
22  compatible:
23    items:
24      - enum:
25          - qcom,pm6150l-flash-led
26          - qcom,pm8150c-flash-led
27          - qcom,pm8150l-flash-led
28          - qcom,pm8350c-flash-led
29      - const: qcom,spmi-flash-led
30
31  reg:
32    maxItems: 1
33
34patternProperties:
35  "^led-[0-3]$":
36    type: object
37    $ref: common.yaml#
38    unevaluatedProperties: false
39    description:
40      Represents the physical LED components which are connected to the
41      flash LED channels' output.
42
43    properties:
44      led-sources:
45        description:
46          The HW indices of the flash LED channels that connect to the
47          physical LED
48        allOf:
49          - minItems: 1
50            maxItems: 2
51            items:
52              enum: [1, 2, 3, 4]
53
54      led-max-microamp:
55        anyOf:
56          - minimum: 5000
57            maximum: 500000
58            multipleOf: 5000
59          - minimum: 10000
60            maximum: 1000000
61            multipleOf: 10000
62
63      flash-max-microamp:
64        anyOf:
65          - minimum: 12500
66            maximum: 1500000
67            multipleOf: 12500
68          - minimum: 25000
69            maximum: 2000000
70            multipleOf: 25000
71
72      flash-max-timeout-us:
73        minimum: 10000
74        maximum: 1280000
75        multipleOf: 10000
76
77    required:
78      - led-sources
79      - led-max-microamp
80
81required:
82  - compatible
83  - reg
84
85additionalProperties: false
86
87examples:
88  - |
89    #include <dt-bindings/leds/common.h>
90    spmi {
91        #address-cells = <1>;
92        #size-cells = <0>;
93        led-controller@ee00 {
94            compatible = "qcom,pm8350c-flash-led", "qcom,spmi-flash-led";
95            reg = <0xee00>;
96
97            led-0 {
98                function = LED_FUNCTION_FLASH;
99                color = <LED_COLOR_ID_WHITE>;
100                led-sources = <1>, <4>;
101                led-max-microamp = <300000>;
102                flash-max-microamp = <2000000>;
103                flash-max-timeout-us = <1280000>;
104                function-enumerator = <0>;
105            };
106
107            led-1 {
108                function = LED_FUNCTION_FLASH;
109                color = <LED_COLOR_ID_YELLOW>;
110                led-sources = <2>, <3>;
111                led-max-microamp = <300000>;
112                flash-max-microamp = <2000000>;
113                flash-max-timeout-us = <1280000>;
114                function-enumerator = <1>;
115            };
116        };
117    };
118