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

regulator: tps65219: Add TI TPS65214 Regulator Support

Add support for TPS65214 regulators (bucks and LDOs) to the TPS65219
Regulator Driver as the TPS65214/TPS65214/TPS65219 PMIC devices have
significant register map overlap. TPS65214 is a Power Management IC with 3
Buck regulators (like TPS65215/TPS65219) and has 2 LDOs (like TPS65215).

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://patch.msgid.link/20250425205736.76433-5-s-ramamoorthy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shree Ramamoorthy and committed by
Mark Brown
f1471bc4 38c9f98d

+69 -13
+7 -2
drivers/regulator/Kconfig
··· 1590 1590 tristate "TI TPS65219 Power regulators" 1591 1591 depends on MFD_TPS65219 && OF 1592 1592 help 1593 - This driver supports TPS65219 series and TPS65215 voltage regulator chips. 1593 + This driver supports TPS65219, TPS65215, and TPS65214 voltage 1594 + regulator chips. 1594 1595 TPS65219 series of PMICs have 3 single phase BUCKs & 4 LDOs 1595 1596 voltage regulators. 1596 1597 TPS65215 PMIC has 3 single phase BUCKs & 2 LDOs. 1597 - Both PMICs support software based voltage control for different voltage domains. 1598 + TPS65214 PMIC has 3 synchronous stepdown DC-DC converters & 2 1599 + LDOs. One LDO supports a maximum output current of 300 mA and the 1600 + other a maximum of 500 mA 1601 + All 3 PMICs support software based voltage control for different 1602 + voltage domains. 1598 1603 1599 1604 config REGULATOR_TPS6594 1600 1605 tristate "TI TPS6594 Power regulators"
+62 -11
drivers/regulator/tps65219-regulator.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 // 3 - // Regulator driver for TPS65215/TPS65219 PMIC 3 + // TPS65214/TPS65215/TPS65219 PMIC Regulator Driver 4 4 // 5 5 // Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/ 6 6 // Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ ··· 29 29 unsigned long event; 30 30 }; 31 31 32 + static struct tps65219_regulator_irq_type tps65215_regulator_irq_types[] = { 33 + { "SENSOR_3_WARM", "SENSOR3", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN}, 34 + { "SENSOR_3_HOT", "SENSOR3", "hot temperature", REGULATOR_EVENT_OVER_TEMP}, 35 + }; 36 + 32 37 static struct tps65219_regulator_irq_type tps65219_regulator_irq_types[] = { 33 38 { "LDO3_SCG", "LDO3", "short circuit to ground", REGULATOR_EVENT_REGULATION_OUT }, 34 39 { "LDO3_OC", "LDO3", "overcurrent", REGULATOR_EVENT_OVER_CURRENT }, ··· 45 40 { "LDO4_RV", "LDO4", "residual voltage", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 46 41 { "LDO3_RV_SD", "LDO3", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 47 42 { "LDO4_RV_SD", "LDO4", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 43 + { "SENSOR_3_WARM", "SENSOR3", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN}, 44 + { "SENSOR_3_HOT", "SENSOR3", "hot temperature", REGULATOR_EVENT_OVER_TEMP}, 48 45 }; 49 46 50 - /* All of TPS65215's irq types are the same as common_regulator_irq_types */ 47 + /* All of TPS65214's irq types are the same as common_regulator_irq_types */ 51 48 static struct tps65219_regulator_irq_type common_regulator_irq_types[] = { 52 49 { "LDO1_SCG", "LDO1", "short circuit to ground", REGULATOR_EVENT_REGULATION_OUT }, 53 50 { "LDO1_OC", "LDO1", "overcurrent", REGULATOR_EVENT_OVER_CURRENT }, ··· 82 75 REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 83 76 { "LDO1_RV_SD", "LDO1", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 84 77 { "LDO2_RV_SD", "LDO2", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN }, 85 - { "SENSOR_3_WARM", "SENSOR3", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN}, 86 78 { "SENSOR_2_WARM", "SENSOR2", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN }, 87 79 { "SENSOR_1_WARM", "SENSOR1", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN }, 88 80 { "SENSOR_0_WARM", "SENSOR0", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN }, 89 - { "SENSOR_3_HOT", "SENSOR3", "hot temperature", REGULATOR_EVENT_OVER_TEMP}, 90 81 { "SENSOR_2_HOT", "SENSOR2", "hot temperature", REGULATOR_EVENT_OVER_TEMP }, 91 82 { "SENSOR_1_HOT", "SENSOR1", "hot temperature", REGULATOR_EVENT_OVER_TEMP }, 92 83 { "SENSOR_0_HOT", "SENSOR0", "hot temperature", REGULATOR_EVENT_OVER_TEMP }, ··· 136 131 static const struct linear_range ldo_1_range[] = { 137 132 REGULATOR_LINEAR_RANGE(600000, 0x0, 0x37, 50000), 138 133 REGULATOR_LINEAR_RANGE(3400000, 0x38, 0x3f, 0), 134 + }; 135 + 136 + static const struct linear_range tps65214_ldo_1_2_range[] = { 137 + REGULATOR_LINEAR_RANGE(600000, 0x0, 0x2, 0), 138 + REGULATOR_LINEAR_RANGE(650000, 0x3, 0x37, 50000), 139 + REGULATOR_LINEAR_RANGE(3300000, 0x38, 0x3F, 0), 139 140 }; 140 141 141 142 static const struct linear_range tps65215_ldo_2_range[] = { ··· 262 251 TPS65219_REG_ENABLE_CTRL, 263 252 TPS65219_ENABLE_BUCK3_EN_MASK, 0, 0, bucks_ranges, 264 253 3, 0, 0, NULL, 0, 0), 254 + }; 255 + 256 + static const struct regulator_desc tps65214_regs[] = { 257 + // TPS65214's LDO3 pin maps to TPS65219's LDO3 pin 258 + TPS65219_REGULATOR("LDO1", "ldo1", TPS65214_LDO_1, 259 + REGULATOR_VOLTAGE, ldos_3_4_ops, 64, 260 + TPS65214_REG_LDO1_VOUT, 261 + TPS65219_BUCKS_LDOS_VOUT_VSET_MASK, 262 + TPS65219_REG_ENABLE_CTRL, 263 + TPS65219_ENABLE_LDO3_EN_MASK, 0, 0, tps65214_ldo_1_2_range, 264 + 3, 0, 0, NULL, 0, 0), 265 + TPS65219_REGULATOR("LDO2", "ldo2", TPS65214_LDO_2, 266 + REGULATOR_VOLTAGE, ldos_3_4_ops, 64, 267 + TPS65214_REG_LDO2_VOUT, 268 + TPS65219_BUCKS_LDOS_VOUT_VSET_MASK, 269 + TPS65219_REG_ENABLE_CTRL, 270 + TPS65219_ENABLE_LDO2_EN_MASK, 0, 0, tps65214_ldo_1_2_range, 271 + 3, 0, 0, NULL, 0, 0), 272 + }; 273 + 274 + static const struct regulator_desc tps65215_regs[] = { 275 + /* 276 + * TPS65215's LDO1 is the same as TPS65219's LDO1. LDO1 is 277 + * configurable as load switch and bypass-mode. 278 + * TPS65215's LDO2 is the same as TPS65219's LDO3 279 + */ 265 280 TPS65219_REGULATOR("LDO1", "ldo1", TPS65219_LDO_1, 266 281 REGULATOR_VOLTAGE, ldos_1_2_ops, 64, 267 282 TPS65219_REG_LDO1_VOUT, ··· 295 258 TPS65219_REG_ENABLE_CTRL, 296 259 TPS65219_ENABLE_LDO1_EN_MASK, 0, 0, ldo_1_range, 297 260 2, 0, 0, NULL, 0, TPS65219_LDOS_BYP_CONFIG_MASK), 298 - }; 299 - 300 - static const struct regulator_desc tps65215_regs[] = { 301 - // TPS65215's LDO2 is the same as TPS65219's LDO3 302 261 TPS65219_REGULATOR("LDO2", "ldo2", TPS65215_LDO_2, 303 262 REGULATOR_VOLTAGE, ldos_3_4_ops, 64, 304 263 TPS65215_REG_LDO2_VOUT, ··· 305 272 }; 306 273 307 274 static const struct regulator_desc tps65219_regs[] = { 275 + TPS65219_REGULATOR("LDO1", "ldo1", TPS65219_LDO_1, 276 + REGULATOR_VOLTAGE, ldos_1_2_ops, 64, 277 + TPS65219_REG_LDO1_VOUT, 278 + TPS65219_BUCKS_LDOS_VOUT_VSET_MASK, 279 + TPS65219_REG_ENABLE_CTRL, 280 + TPS65219_ENABLE_LDO1_EN_MASK, 0, 0, ldo_1_range, 281 + 2, 0, 0, NULL, 0, TPS65219_LDOS_BYP_CONFIG_MASK), 308 282 TPS65219_REGULATOR("LDO2", "ldo2", TPS65219_LDO_2, 309 283 REGULATOR_VOLTAGE, ldos_1_2_ops, 64, 310 284 TPS65219_REG_LDO2_VOUT, ··· 366 326 }; 367 327 368 328 static struct tps65219_chip_data chip_info_table[] = { 329 + [TPS65214] = { 330 + .rdesc = tps65214_regs, 331 + .rdesc_size = ARRAY_SIZE(tps65214_regs), 332 + .common_rdesc = common_regs, 333 + .common_rdesc_size = ARRAY_SIZE(common_regs), 334 + .irq_types = NULL, 335 + .dev_irq_size = 0, 336 + .common_irq_types = common_regulator_irq_types, 337 + .common_irq_size = ARRAY_SIZE(common_regulator_irq_types), 338 + }, 369 339 [TPS65215] = { 370 340 .rdesc = tps65215_regs, 371 341 .rdesc_size = ARRAY_SIZE(tps65215_regs), 372 342 .common_rdesc = common_regs, 373 343 .common_rdesc_size = ARRAY_SIZE(common_regs), 374 - .irq_types = NULL, 375 - .dev_irq_size = 0, 344 + .irq_types = tps65215_regulator_irq_types, 345 + .dev_irq_size = ARRAY_SIZE(tps65215_regulator_irq_types), 376 346 .common_irq_types = common_regulator_irq_types, 377 347 .common_irq_size = ARRAY_SIZE(common_regulator_irq_types), 378 348 }, ··· 486 436 } 487 437 488 438 static const struct platform_device_id tps65219_regulator_id_table[] = { 439 + { "tps65214-regulator", TPS65214 }, 489 440 { "tps65215-regulator", TPS65215 }, 490 441 { "tps65219-regulator", TPS65219 }, 491 442 { /* sentinel */ } ··· 505 454 module_platform_driver(tps65219_regulator_driver); 506 455 507 456 MODULE_AUTHOR("Jerome Neanne <j-neanne@baylibre.com>"); 508 - MODULE_DESCRIPTION("TPS65215/TPS65219 voltage regulator driver"); 457 + MODULE_DESCRIPTION("TPS65214/TPS65215/TPS65219 Regulator driver"); 509 458 MODULE_LICENSE("GPL");