0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/leds-qcom-lpg.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Qualcomm Light Pulse Generator
0008
0009 maintainers:
0010 - Bjorn Andersson <bjorn.andersson@linaro.org>
0011
0012 description: >
0013 The Qualcomm Light Pulse Generator consists of three different hardware blocks;
0014 a ramp generator with lookup table, the light pulse generator and a three
0015 channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
0016
0017 properties:
0018 compatible:
0019 enum:
0020 - qcom,pm660l-lpg
0021 - qcom,pm8150b-lpg
0022 - qcom,pm8150l-lpg
0023 - qcom,pm8350c-pwm
0024 - qcom,pm8916-pwm
0025 - qcom,pm8941-lpg
0026 - qcom,pm8994-lpg
0027 - qcom,pmc8180c-lpg
0028 - qcom,pmi8994-lpg
0029 - qcom,pmi8998-lpg
0030
0031 "#pwm-cells":
0032 const: 2
0033
0034 "#address-cells":
0035 const: 1
0036
0037 "#size-cells":
0038 const: 0
0039
0040 qcom,power-source:
0041 $ref: /schemas/types.yaml#/definitions/uint32
0042 description:
0043 power-source used to drive the output, as defined in the datasheet.
0044 Should be specified if the TRILED block is present
0045 enum: [0, 1, 3]
0046
0047 qcom,dtest:
0048 $ref: /schemas/types.yaml#/definitions/uint32-matrix
0049 description: >
0050 A list of integer pairs, where each pair represent the dtest line the
0051 particular channel should be connected to and the flags denoting how the
0052 value should be outputed, as defined in the datasheet. The number of
0053 pairs should be the same as the number of channels.
0054 items:
0055 items:
0056 - description: dtest line to attach
0057 - description: flags for the attachment
0058
0059 multi-led:
0060 type: object
0061 $ref: leds-class-multicolor.yaml#
0062 unevaluatedProperties: false
0063
0064 properties:
0065 "#address-cells":
0066 const: 1
0067
0068 "#size-cells":
0069 const: 0
0070
0071 patternProperties:
0072 "^led@[0-9a-f]$":
0073 type: object
0074 $ref: common.yaml#
0075
0076 patternProperties:
0077 "^led@[0-9a-f]$":
0078 type: object
0079 $ref: common.yaml#
0080
0081 properties:
0082 reg: true
0083
0084 required:
0085 - reg
0086
0087 required:
0088 - compatible
0089
0090 additionalProperties: false
0091
0092 examples:
0093 - |
0094 #include <dt-bindings/leds/common.h>
0095
0096 led-controller {
0097 compatible = "qcom,pmi8994-lpg";
0098
0099 #address-cells = <1>;
0100 #size-cells = <0>;
0101
0102 qcom,power-source = <1>;
0103
0104 qcom,dtest = <0 0>,
0105 <0 0>,
0106 <0 0>,
0107 <4 1>;
0108
0109 led@1 {
0110 reg = <1>;
0111 color = <LED_COLOR_ID_GREEN>;
0112 function = LED_FUNCTION_INDICATOR;
0113 function-enumerator = <1>;
0114 };
0115
0116 led@2 {
0117 reg = <2>;
0118 color = <LED_COLOR_ID_GREEN>;
0119 function = LED_FUNCTION_INDICATOR;
0120 function-enumerator = <0>;
0121 default-state = "on";
0122 };
0123
0124 led@3 {
0125 reg = <3>;
0126 color = <LED_COLOR_ID_GREEN>;
0127 function = LED_FUNCTION_INDICATOR;
0128 function-enumerator = <2>;
0129 };
0130
0131 led@4 {
0132 reg = <4>;
0133 color = <LED_COLOR_ID_GREEN>;
0134 function = LED_FUNCTION_INDICATOR;
0135 function-enumerator = <3>;
0136 };
0137 };
0138 - |
0139 #include <dt-bindings/leds/common.h>
0140
0141 led-controller {
0142 compatible = "qcom,pmi8994-lpg";
0143
0144 #address-cells = <1>;
0145 #size-cells = <0>;
0146
0147 qcom,power-source = <1>;
0148
0149 multi-led {
0150 color = <LED_COLOR_ID_RGB>;
0151 function = LED_FUNCTION_STATUS;
0152
0153 #address-cells = <1>;
0154 #size-cells = <0>;
0155
0156 led@1 {
0157 reg = <1>;
0158 color = <LED_COLOR_ID_RED>;
0159 };
0160
0161 led@2 {
0162 reg = <2>;
0163 color = <LED_COLOR_ID_GREEN>;
0164 };
0165
0166 led@3 {
0167 reg = <3>;
0168 color = <LED_COLOR_ID_BLUE>;
0169 };
0170 };
0171 };
0172 - |
0173 pwm-controller {
0174 compatible = "qcom,pm8916-pwm";
0175 #pwm-cells = <2>;
0176 };
0177 ...