Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 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-mt6360.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: LED driver for MT6360 PMIC from MediaTek Integrated. |
| 8 | |
| 9 | maintainers: |
| 10 | - Gene Chen <gene_chen@richtek.com> |
| 11 | |
| 12 | description: | |
| 13 | This module is part of the MT6360 MFD device. |
| 14 | see Documentation/devicetree/bindings/mfd/mediatek,mt6360.yaml |
| 15 | Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, |
| 16 | and 4-channel RGB LED support Register/Flash/Breath Mode |
| 17 | |
| 18 | properties: |
| 19 | compatible: |
| 20 | const: mediatek,mt6360-led |
| 21 | |
| 22 | "#address-cells": |
| 23 | const: 1 |
| 24 | |
| 25 | "#size-cells": |
| 26 | const: 0 |
| 27 | |
| 28 | patternProperties: |
| 29 | "^multi-led@[0-5]$": |
| 30 | type: object |
| 31 | $ref: leds-class-multicolor.yaml# |
| 32 | unevaluatedProperties: false |
| 33 | |
| 34 | properties: |
| 35 | reg: |
| 36 | description: Index of the LED. |
| 37 | enum: |
| 38 | - 0 # LED output ISINK1 |
| 39 | - 1 # LED output ISINK2 |
| 40 | - 2 # LED output ISINK3 |
| 41 | - 3 # LED output ISINKML |
| 42 | - 4 # LED output FLASH1 |
| 43 | - 5 # LED output FLASH2 |
| 44 | |
| 45 | "#address-cells": |
| 46 | const: 1 |
| 47 | |
| 48 | "#size-cells": |
| 49 | const: 0 |
| 50 | |
| 51 | patternProperties: |
| 52 | "^led@[0-2]$": |
| 53 | type: object |
| 54 | $ref: common.yaml# |
| 55 | unevaluatedProperties: false |
| 56 | |
| 57 | properties: |
| 58 | reg: |
| 59 | enum: [0, 1, 2] |
| 60 | |
| 61 | required: |
| 62 | - reg |
| 63 | - color |
| 64 | |
| 65 | required: |
| 66 | - reg |
| 67 | - "#address-cells" |
| 68 | - "#size-cells" |
| 69 | |
| 70 | "^led@[0-5]$": |
| 71 | type: object |
| 72 | $ref: common.yaml# |
| 73 | unevaluatedProperties: false |
| 74 | description: |
| 75 | Properties for a single LED. |
| 76 | |
| 77 | properties: |
| 78 | reg: |
| 79 | enum: [0, 1, 2, 3, 4, 5] |
| 80 | |
| 81 | required: |
| 82 | - compatible |
| 83 | - "#address-cells" |
| 84 | - "#size-cells" |
| 85 | |
| 86 | additionalProperties: false |
| 87 | |
| 88 | examples: |
| 89 | - | |
| 90 | #include <dt-bindings/leds/common.h> |
| 91 | led-controller { |
| 92 | compatible = "mediatek,mt6360-led"; |
| 93 | #address-cells = <1>; |
| 94 | #size-cells = <0>; |
| 95 | |
| 96 | multi-led@0 { |
| 97 | reg = <0>; |
| 98 | function = LED_FUNCTION_INDICATOR; |
| 99 | color = <LED_COLOR_ID_RGB>; |
| 100 | led-max-microamp = <24000>; |
| 101 | #address-cells = <1>; |
| 102 | #size-cells = <0>; |
| 103 | led@0 { |
| 104 | reg = <0>; |
| 105 | color = <LED_COLOR_ID_RED>; |
| 106 | }; |
| 107 | led@1 { |
| 108 | reg = <1>; |
| 109 | color = <LED_COLOR_ID_GREEN>; |
| 110 | }; |
| 111 | led@2 { |
| 112 | reg = <2>; |
| 113 | color = <LED_COLOR_ID_BLUE>; |
| 114 | }; |
| 115 | }; |
| 116 | led@3 { |
| 117 | reg = <3>; |
| 118 | function = LED_FUNCTION_INDICATOR; |
| 119 | color = <LED_COLOR_ID_WHITE>; |
| 120 | led-max-microamp = <150000>; |
| 121 | }; |
| 122 | led@4 { |
| 123 | reg = <4>; |
| 124 | function = LED_FUNCTION_FLASH; |
| 125 | color = <LED_COLOR_ID_WHITE>; |
| 126 | function-enumerator = <1>; |
| 127 | led-max-microamp = <200000>; |
| 128 | flash-max-microamp = <500000>; |
| 129 | flash-max-timeout-us = <1024000>; |
| 130 | }; |
| 131 | led@5 { |
| 132 | reg = <5>; |
| 133 | function = LED_FUNCTION_FLASH; |
| 134 | color = <LED_COLOR_ID_WHITE>; |
| 135 | function-enumerator = <2>; |
| 136 | led-max-microamp = <200000>; |
| 137 | flash-max-microamp = <500000>; |
| 138 | flash-max-timeout-us = <1024000>; |
| 139 | }; |
| 140 | }; |
| 141 | |
| 142 | - | |
| 143 | |
| 144 | led-controller { |
| 145 | compatible = "mediatek,mt6360-led"; |
| 146 | #address-cells = <1>; |
| 147 | #size-cells = <0>; |
| 148 | |
| 149 | led@0 { |
| 150 | reg = <0>; |
| 151 | function = LED_FUNCTION_INDICATOR; |
| 152 | color = <LED_COLOR_ID_RED>; |
| 153 | led-max-microamp = <24000>; |
| 154 | }; |
| 155 | led@1 { |
| 156 | reg = <1>; |
| 157 | function = LED_FUNCTION_INDICATOR; |
| 158 | color = <LED_COLOR_ID_GREEN>; |
| 159 | led-max-microamp = <24000>; |
| 160 | }; |
| 161 | led@2 { |
| 162 | reg = <2>; |
| 163 | function = LED_FUNCTION_INDICATOR; |
| 164 | color = <LED_COLOR_ID_BLUE>; |
| 165 | led-max-microamp = <24000>; |
| 166 | }; |
| 167 | led@3 { |
| 168 | reg = <3>; |
| 169 | function = LED_FUNCTION_INDICATOR; |
| 170 | color = <LED_COLOR_ID_WHITE>; |
| 171 | led-max-microamp = <150000>; |
| 172 | }; |
| 173 | led@4 { |
| 174 | reg = <4>; |
| 175 | function = LED_FUNCTION_FLASH; |
| 176 | color = <LED_COLOR_ID_WHITE>; |
| 177 | function-enumerator = <1>; |
| 178 | led-max-microamp = <200000>; |
| 179 | flash-max-microamp = <500000>; |
| 180 | flash-max-timeout-us = <1024000>; |
| 181 | }; |
| 182 | led@5 { |
| 183 | reg = <5>; |
| 184 | function = LED_FUNCTION_FLASH; |
| 185 | color = <LED_COLOR_ID_WHITE>; |
| 186 | function-enumerator = <2>; |
| 187 | led-max-microamp = <200000>; |
| 188 | flash-max-microamp = <500000>; |
| 189 | flash-max-timeout-us = <1024000>; |
| 190 | }; |
| 191 | }; |
| 192 | ... |