299 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---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 Generator8 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 (LUT), the light pulse generator and a three15 channel current sink. These blocks are found in a wide range of Qualcomm PMICs.16 17properties:18 compatible:19 oneOf:20 - enum:21 - qcom,pm660l-lpg22 - qcom,pm8150b-lpg23 - qcom,pm8150l-lpg24 - qcom,pm8350c-pwm25 - qcom,pm8916-pwm26 - qcom,pm8941-lpg27 - qcom,pm8994-lpg28 - qcom,pmc8180c-lpg29 - qcom,pmi632-lpg30 - qcom,pmi8950-pwm31 - qcom,pmi8994-lpg32 - qcom,pmi8998-lpg33 - qcom,pmk8550-pwm34 - items:35 - enum:36 - qcom,pm6150l-lpg37 - const: qcom,pm8150l-lpg38 - items:39 - enum:40 - qcom,pm8550-pwm41 - const: qcom,pm8350c-pwm42 43 "#pwm-cells":44 const: 245 46 "#address-cells":47 const: 148 49 "#size-cells":50 const: 051 52 qcom,power-source:53 $ref: /schemas/types.yaml#/definitions/uint3254 description:55 power-source used to drive the output, as defined in the datasheet.56 Should be specified if the TRILED block is present57 enum: [0, 1, 3]58 59 qcom,dtest:60 $ref: /schemas/types.yaml#/definitions/uint32-matrix61 description: >62 A list of integer pairs, where each pair represent the dtest line the63 particular channel should be connected to and the flags denoting how the64 value should be outputted, as defined in the datasheet. The number of65 pairs should be the same as the number of channels.66 items:67 items:68 - description: dtest line to attach69 - description: flags for the attachment70 71 nvmem:72 description: >73 This property is required for PMICs that supports PPG, which is when a74 PMIC stores LPG per-channel data and pattern LUT in SDAM modules instead75 of in a LUT peripheral. For PMICs, such as PM8350C, per-channel data76 and pattern LUT is separated into 2 SDAM modules. In that case, phandles77 to both SDAM modules need to be specified.78 minItems: 179 maxItems: 280 81 nvmem-names:82 minItems: 183 items:84 - const: lpg_chan_sdam85 - const: lut_sdam86 87 qcom,pbs:88 $ref: /schemas/types.yaml#/definitions/phandle89 description: >90 Phandle of the Qualcomm Programmable Boot Sequencer node (PBS).91 PBS node is used to trigger LPG pattern sequences for PMICs that support92 single SDAM PPG.93 94 multi-led:95 type: object96 $ref: leds-class-multicolor.yaml#97 unevaluatedProperties: false98 99 properties:100 "#address-cells":101 const: 1102 103 "#size-cells":104 const: 0105 106 patternProperties:107 "^led@[0-9a-f]$":108 type: object109 $ref: common.yaml#110 unevaluatedProperties: false111 112 properties:113 reg:114 maxItems: 1115 116 required:117 - reg118 119patternProperties:120 "^led@[0-9a-f]$":121 type: object122 $ref: common.yaml#123 unevaluatedProperties: false124 125 properties:126 reg:127 maxItems: 1128 129 required:130 - reg131 132required:133 - compatible134 135additionalProperties: false136 137allOf:138 - if:139 properties:140 compatible:141 contains:142 enum:143 - qcom,pm660l-lpg144 - qcom,pm8150b-lpg145 - qcom,pm8150l-lpg146 - qcom,pm8916-pwm147 - qcom,pm8941-lpg148 - qcom,pm8994-lpg149 - qcom,pmc8180c-lpg150 - qcom,pmi8950-pwm151 - qcom,pmi8994-lpg152 - qcom,pmi8998-lpg153 - qcom,pmk8550-pwm154 then:155 properties:156 nvmem: false157 nvmem-names: false158 159 - if:160 properties:161 compatible:162 contains:163 const: qcom,pmi632-lpg164 then:165 properties:166 nvmem:167 maxItems: 1168 nvmem-names:169 maxItems: 1170 171 - if:172 properties:173 compatible:174 contains:175 enum:176 - qcom,pm8350c-pwm177 then:178 properties:179 nvmem:180 minItems: 2181 nvmem-names:182 minItems: 2183 184examples:185 - |186 #include <dt-bindings/leds/common.h>187 188 led-controller {189 compatible = "qcom,pmi8994-lpg";190 191 #address-cells = <1>;192 #size-cells = <0>;193 194 qcom,power-source = <1>;195 196 qcom,dtest = <0 0>,197 <0 0>,198 <0 0>,199 <4 1>;200 201 led@1 {202 reg = <1>;203 color = <LED_COLOR_ID_GREEN>;204 function = LED_FUNCTION_INDICATOR;205 function-enumerator = <1>;206 };207 208 led@2 {209 reg = <2>;210 color = <LED_COLOR_ID_GREEN>;211 function = LED_FUNCTION_INDICATOR;212 function-enumerator = <0>;213 default-state = "on";214 };215 216 led@3 {217 reg = <3>;218 color = <LED_COLOR_ID_GREEN>;219 function = LED_FUNCTION_INDICATOR;220 function-enumerator = <2>;221 };222 223 led@4 {224 reg = <4>;225 color = <LED_COLOR_ID_GREEN>;226 function = LED_FUNCTION_INDICATOR;227 function-enumerator = <3>;228 };229 };230 - |231 #include <dt-bindings/leds/common.h>232 233 led-controller {234 compatible = "qcom,pmi8994-lpg";235 236 #address-cells = <1>;237 #size-cells = <0>;238 239 qcom,power-source = <1>;240 241 multi-led {242 color = <LED_COLOR_ID_RGB>;243 function = LED_FUNCTION_STATUS;244 245 #address-cells = <1>;246 #size-cells = <0>;247 248 led@1 {249 reg = <1>;250 color = <LED_COLOR_ID_RED>;251 };252 253 led@2 {254 reg = <2>;255 color = <LED_COLOR_ID_GREEN>;256 };257 258 led@3 {259 reg = <3>;260 color = <LED_COLOR_ID_BLUE>;261 };262 };263 };264 - |265 pwm-controller {266 compatible = "qcom,pm8916-pwm";267 #pwm-cells = <2>;268 };269 - |270 #include <dt-bindings/leds/common.h>271 272 led-controller {273 compatible = "qcom,pmi632-lpg";274 #address-cells = <1>;275 #size-cells = <0>;276 #pwm-cells = <2>;277 nvmem-names = "lpg_chan_sdam";278 nvmem = <&pmi632_sdam_7>;279 qcom,pbs = <&pmi632_pbs_client3>;280 281 led@1 {282 reg = <1>;283 color = <LED_COLOR_ID_RED>;284 label = "red";285 };286 287 led@2 {288 reg = <2>;289 color = <LED_COLOR_ID_GREEN>;290 label = "green";291 };292 293 led@3 {294 reg = <3>;295 color = <LED_COLOR_ID_BLUE>;296 label = "blue";297 };298 };299