Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: mfd: maxim,max8998: Convert to DT schema

Convert the bindings for Maxim MAX8998, National/TI LP3974 Power
Management IC to DT schema. Adjust example to real DTS and make second
interrupt optional (like on s5pv210-aries.dtsi).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230911120135.37528-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
a8e49836 917991aa

+324 -125
-125
Documentation/devicetree/bindings/mfd/max8998.txt
··· 1 - * Maxim MAX8998, National/TI LP3974 multi-function device 2 - 3 - The Maxim MAX8998 is a multi-function device which includes voltage/current 4 - regulators, real time clock, battery charging controller and several 5 - other sub-blocks. It is interfaced using an I2C interface. Each sub-block 6 - is addressed by the host system using different i2c slave address. 7 - 8 - PMIC sub-block 9 - -------------- 10 - 11 - The PMIC sub-block contains a number of voltage and current regulators, 12 - with controllable parameters and dynamic voltage scaling capability. 13 - In addition, it includes a real time clock and battery charging controller 14 - as well. It is accessible at I2C address 0x66. 15 - 16 - Required properties: 17 - - compatible: Should be one of the following: 18 - - "maxim,max8998" for Maxim MAX8998 19 - - "national,lp3974" or "ti,lp3974" for National/TI LP3974. 20 - - reg: Specifies the i2c slave address of the pmic block. It should be 0x66. 21 - 22 - Optional properties: 23 - - interrupts: Interrupt specifiers for two interrupt sources. 24 - - First interrupt specifier is for main interrupt. 25 - - Second interrupt specifier is for power-on/-off interrupt. 26 - - max8998,pmic-buck1-dvs-gpios: GPIO specifiers for two host gpios used 27 - for buck 1 dvs. The format of the gpio specifier depends on the gpio 28 - controller. 29 - - max8998,pmic-buck2-dvs-gpio: GPIO specifier for host gpio used 30 - for buck 2 dvs. The format of the gpio specifier depends on the gpio 31 - controller. 32 - - max8998,pmic-buck1-default-dvs-idx: Default voltage setting selected from 33 - the possible 4 options selectable by the dvs gpios. The value of this 34 - property should be 0, 1, 2 or 3. If not specified or out of range, 35 - a default value of 0 is taken. 36 - - max8998,pmic-buck2-default-dvs-idx: Default voltage setting selected from 37 - the possible 2 options selectable by the dvs gpios. The value of this 38 - property should be 0 or 1. If not specified or out of range, a default 39 - value of 0 is taken. 40 - - max8998,pmic-buck-voltage-lock: If present, disallows changing of 41 - preprogrammed buck dvfs voltages. 42 - 43 - Additional properties required if max8998,pmic-buck1-dvs-gpios is defined: 44 - - max8998,pmic-buck1-dvs-voltage: An array of 4 voltage values in microvolts 45 - for buck1 regulator that can be selected using dvs gpio. 46 - 47 - Additional properties required if max8998,pmic-buck2-dvs-gpio is defined: 48 - - max8998,pmic-buck2-dvs-voltage: An array of 2 voltage values in microvolts 49 - for buck2 regulator that can be selected using dvs gpio. 50 - 51 - Regulators: All the regulators of MAX8998 to be instantiated shall be 52 - listed in a child node named 'regulators'. Each regulator is represented 53 - by a child node of the 'regulators' node. 54 - 55 - regulator-name { 56 - /* standard regulator bindings here */ 57 - }; 58 - 59 - Following regulators of the MAX8998 PMIC block are supported. Note that 60 - the 'n' in regulator name, as in LDOn or BUCKn, represents the LDO or BUCK 61 - number as described in MAX8998 datasheet. 62 - 63 - - LDOn 64 - - valid values for n are 2 to 17 65 - - Example: LDO2, LDO10, LDO17 66 - - BUCKn 67 - - valid values for n are 1 to 4. 68 - - Example: BUCK1, BUCK2, BUCK3, BUCK4 69 - 70 - - ENVICHG: Battery Charging Current Monitor Output. This is a fixed 71 - voltage type regulator 72 - 73 - - ESAFEOUT1: (ldo19) 74 - - ESAFEOUT2: (ld020) 75 - 76 - - CHARGER: main battery charger current control 77 - 78 - Standard regulator bindings are used inside regulator subnodes. Check 79 - Documentation/devicetree/bindings/regulator/regulator.txt 80 - for more details. 81 - 82 - Example: 83 - 84 - pmic@66 { 85 - compatible = "maxim,max8998-pmic"; 86 - reg = <0x66>; 87 - interrupt-parent = <&wakeup_eint>; 88 - interrupts = <4 0>, <3 0>; 89 - 90 - /* Buck 1 DVS settings */ 91 - max8998,pmic-buck1-default-dvs-idx = <0>; 92 - max8998,pmic-buck1-dvs-gpios = <&gpx0 0 1 0 0>, /* SET1 */ 93 - <&gpx0 1 1 0 0>; /* SET2 */ 94 - max8998,pmic-buck1-dvs-voltage = <1350000>, <1300000>, 95 - <1000000>, <950000>; 96 - 97 - /* Buck 2 DVS settings */ 98 - max8998,pmic-buck2-default-dvs-idx = <0>; 99 - max8998,pmic-buck2-dvs-gpio = <&gpx0 0 3 0 0>; /* SET3 */ 100 - max8998,pmic-buck2-dvs-voltage = <1350000>, <1300000>; 101 - 102 - /* Regulators to instantiate */ 103 - regulators { 104 - ldo2_reg: LDO2 { 105 - regulator-name = "VDD_ALIVE_1.1V"; 106 - regulator-min-microvolt = <1100000>; 107 - regulator-max-microvolt = <1100000>; 108 - regulator-always-on; 109 - }; 110 - 111 - buck1_reg: BUCK1 { 112 - regulator-name = "VDD_ARM_1.2V"; 113 - regulator-min-microvolt = <950000>; 114 - regulator-max-microvolt = <1350000>; 115 - regulator-always-on; 116 - regulator-boot-on; 117 - }; 118 - 119 - charger_reg: CHARGER { 120 - regulator-name = "CHARGER"; 121 - regulator-min-microamp = <90000>; 122 - regulator-max-microamp = <800000>; 123 - }; 124 - }; 125 - };
+324
Documentation/devicetree/bindings/mfd/maxim,max8998.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/maxim,max8998.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX8998, National/TI LP3974 Power Management IC 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzk@kernel.org> 11 + 12 + description: 13 + The Maxim MAX8998 is a Power Management IC which includes voltage/current 14 + regulators, real time clock, battery charging controller and several other 15 + sub-blocks. It is interfaced using an I2C interface. Each sub-block is 16 + addressed by the host system using different i2c slave address. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - maxim,max8998 22 + - national,lp3974 23 + - ti,lp3974 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + interrupts: 29 + minItems: 1 30 + items: 31 + - description: Main interrupt 32 + - description: Power-on/-off interrupt 33 + 34 + max8998,pmic-buck1-dvs-gpios: 35 + maxItems: 2 36 + description: 37 + Two host gpios used for buck1 DVS. 38 + 39 + max8998,pmic-buck2-dvs-gpio: 40 + maxItems: 1 41 + description: 42 + Host gpio used for buck2 DVS. 43 + 44 + max8998,pmic-buck1-default-dvs-idx: 45 + $ref: /schemas/types.yaml#/definitions/uint32 46 + enum: [0, 1, 2, 3] 47 + default: 0 48 + description: 49 + Default voltage setting selected from the possible 4 options selectable 50 + by the DVS gpios. 51 + 52 + max8998,pmic-buck2-default-dvs-idx: 53 + $ref: /schemas/types.yaml#/definitions/uint32 54 + enum: [0, 1] 55 + default: 0 56 + description: 57 + Default voltage setting selected from the possible 2 options selectable 58 + by the DVS GPIOs. 59 + 60 + max8998,pmic-buck-voltage-lock: 61 + type: boolean 62 + description: 63 + If present, disallows changing of preprogrammed buck DVS voltages. 64 + 65 + max8998,pmic-buck1-dvs-voltage: 66 + $ref: /schemas/types.yaml#/definitions/uint32-array 67 + maxItems: 4 68 + description: 69 + Four voltage values in microvolts for buck1 regulator that can be 70 + selected using DVS GPIO. 71 + 72 + max8998,pmic-buck2-dvs-voltage: 73 + $ref: /schemas/types.yaml#/definitions/uint32-array 74 + maxItems: 2 75 + description: 76 + Two voltage values in microvolts for buck2 regulator that can be 77 + selected using DVS GPIO. 78 + 79 + regulators: 80 + type: object 81 + additionalProperties: false 82 + 83 + properties: 84 + CHARGER: 85 + type: object 86 + $ref: /schemas/regulator/regulator.yaml# 87 + unevaluatedProperties: false 88 + description: 89 + CHARGER is main battery charger current control, wrongly represented 90 + as regulator. 91 + 92 + properties: 93 + regulator-min-microamp: 94 + minimum: 90000 95 + maximum: 800000 96 + 97 + regulator-max-microamp: 98 + minimum: 90000 99 + maximum: 800000 100 + 101 + regulator-min-microvolt: false 102 + regulator-max-microvolt: false 103 + 104 + required: 105 + - regulator-name 106 + 107 + patternProperties: 108 + "^(LDO([2-9]|1[0-7])|BUCK[1-4])$": 109 + type: object 110 + $ref: /schemas/regulator/regulator.yaml# 111 + unevaluatedProperties: false 112 + 113 + required: 114 + - regulator-name 115 + 116 + "^(EN32KHz-AP|EN32KHz-CP|ENVICHG|ESAFEOUT[12])$": 117 + type: object 118 + $ref: /schemas/regulator/regulator.yaml# 119 + unevaluatedProperties: false 120 + description: | 121 + EN32KHz-AP and EN32KHz-CP are 32768 Hz clocks, wrongly represented as 122 + regulators. 123 + ENVICHG is a Battery Charging Current Monitor Output. 124 + 125 + properties: 126 + regulator-min-microvolt: false 127 + regulator-max-microvolt: false 128 + 129 + required: 130 + - regulator-name 131 + 132 + dependencies: 133 + max8998,pmic-buck1-dvs-gpios: [ "max8998,pmic-buck1-dvs-voltage" ] 134 + max8998,pmic-buck2-dvs-gpio: [ "max8998,pmic-buck2-dvs-voltage" ] 135 + 136 + required: 137 + - compatible 138 + - reg 139 + - regulators 140 + 141 + additionalProperties: false 142 + 143 + examples: 144 + - | 145 + #include <dt-bindings/gpio/gpio.h> 146 + #include <dt-bindings/interrupt-controller/irq.h> 147 + 148 + i2c { 149 + #address-cells = <1>; 150 + #size-cells = <0>; 151 + 152 + pmic@66 { 153 + compatible = "national,lp3974"; 154 + reg = <0x66>; 155 + interrupts-extended = <&gpx0 7 IRQ_TYPE_LEVEL_LOW>, 156 + <&gpx2 7 IRQ_TYPE_LEVEL_LOW>; 157 + pinctrl-names = "default"; 158 + pinctrl-0 = <&lp3974_irq>; 159 + 160 + max8998,pmic-buck1-default-dvs-idx = <0>; 161 + max8998,pmic-buck1-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>, 162 + <&gpx0 6 GPIO_ACTIVE_HIGH>; 163 + max8998,pmic-buck1-dvs-voltage = <1100000>, <1000000>, 164 + <1100000>, <1000000>; 165 + max8998,pmic-buck2-default-dvs-idx = <0>; 166 + max8998,pmic-buck2-dvs-gpio = <&gpe2 0 GPIO_ACTIVE_HIGH>; 167 + max8998,pmic-buck2-dvs-voltage = <1200000>, <1100000>; 168 + 169 + regulators { 170 + LDO2 { 171 + regulator-name = "VALIVE_1.2V"; 172 + regulator-min-microvolt = <1200000>; 173 + regulator-max-microvolt = <1200000>; 174 + regulator-always-on; 175 + }; 176 + 177 + LDO3 { 178 + regulator-name = "VUSB+MIPI_1.1V"; 179 + regulator-min-microvolt = <1100000>; 180 + regulator-max-microvolt = <1100000>; 181 + regulator-always-on; 182 + }; 183 + 184 + LDO4 { 185 + regulator-name = "VADC_3.3V"; 186 + regulator-min-microvolt = <3300000>; 187 + regulator-max-microvolt = <3300000>; 188 + }; 189 + 190 + LDO5 { 191 + regulator-name = "VTF_2.8V"; 192 + regulator-min-microvolt = <2800000>; 193 + regulator-max-microvolt = <2800000>; 194 + }; 195 + 196 + LDO6 { 197 + regulator-name = "LDO6"; 198 + regulator-min-microvolt = <2000000>; 199 + regulator-max-microvolt = <2000000>; 200 + }; 201 + 202 + LDO7 { 203 + regulator-name = "VLCD+VMIPI_1.8V"; 204 + regulator-min-microvolt = <1800000>; 205 + regulator-max-microvolt = <1800000>; 206 + }; 207 + 208 + LDO8 { 209 + regulator-name = "VUSB+VDAC_3.3V"; 210 + regulator-min-microvolt = <3300000>; 211 + regulator-max-microvolt = <3300000>; 212 + regulator-always-on; 213 + }; 214 + 215 + LDO9 { 216 + regulator-name = "VCC_2.8V"; 217 + regulator-min-microvolt = <2800000>; 218 + regulator-max-microvolt = <2800000>; 219 + regulator-always-on; 220 + }; 221 + 222 + LDO10 { 223 + regulator-name = "VPLL_1.1V"; 224 + regulator-min-microvolt = <1100000>; 225 + regulator-max-microvolt = <1100000>; 226 + regulator-boot-on; 227 + regulator-always-on; 228 + }; 229 + 230 + LDO11 { 231 + regulator-name = "CAM_AF_3.3V"; 232 + regulator-min-microvolt = <3300000>; 233 + regulator-max-microvolt = <3300000>; 234 + }; 235 + 236 + LDO12 { 237 + regulator-name = "PS_2.8V"; 238 + regulator-min-microvolt = <2800000>; 239 + regulator-max-microvolt = <2800000>; 240 + }; 241 + 242 + LDO13 { 243 + regulator-name = "VHIC_1.2V"; 244 + regulator-min-microvolt = <1200000>; 245 + regulator-max-microvolt = <1200000>; 246 + }; 247 + 248 + LDO14 { 249 + regulator-name = "CAM_I_HOST_1.8V"; 250 + regulator-min-microvolt = <1800000>; 251 + regulator-max-microvolt = <1800000>; 252 + }; 253 + 254 + LDO15 { 255 + regulator-name = "CAM_S_DIG+FM33_CORE_1.2V"; 256 + regulator-min-microvolt = <1200000>; 257 + regulator-max-microvolt = <1200000>; 258 + }; 259 + 260 + LDO16 { 261 + regulator-name = "CAM_S_ANA_2.8V"; 262 + regulator-min-microvolt = <2800000>; 263 + regulator-max-microvolt = <2800000>; 264 + }; 265 + 266 + LDO17 { 267 + regulator-name = "VCC_3.0V_LCD"; 268 + regulator-min-microvolt = <3000000>; 269 + regulator-max-microvolt = <3000000>; 270 + }; 271 + 272 + BUCK1 { 273 + regulator-name = "VINT_1.1V"; 274 + regulator-min-microvolt = <750000>; 275 + regulator-max-microvolt = <1500000>; 276 + regulator-boot-on; 277 + regulator-always-on; 278 + }; 279 + 280 + BUCK2 { 281 + regulator-name = "VG3D_1.1V"; 282 + regulator-min-microvolt = <750000>; 283 + regulator-max-microvolt = <1500000>; 284 + regulator-boot-on; 285 + }; 286 + 287 + BUCK3 { 288 + regulator-name = "VCC_1.8V"; 289 + regulator-min-microvolt = <1800000>; 290 + regulator-max-microvolt = <1800000>; 291 + regulator-always-on; 292 + }; 293 + 294 + BUCK4 { 295 + regulator-name = "VMEM_1.2V"; 296 + regulator-min-microvolt = <1200000>; 297 + regulator-max-microvolt = <1200000>; 298 + regulator-always-on; 299 + }; 300 + 301 + EN32KHz-AP { 302 + regulator-name = "32KHz AP"; 303 + regulator-always-on; 304 + }; 305 + 306 + EN32KHz-CP { 307 + regulator-name = "32KHz CP"; 308 + }; 309 + 310 + ENVICHG { 311 + regulator-name = "VICHG"; 312 + }; 313 + 314 + ESAFEOUT1 { 315 + regulator-name = "SAFEOUT1"; 316 + }; 317 + 318 + ESAFEOUT2 { 319 + regulator-name = "SAFEOUT2"; 320 + regulator-boot-on; 321 + }; 322 + }; 323 + }; 324 + };