Skip to content

Commit f1471bc

Browse files
shramamoorthybroonie
authored andcommitted
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>
1 parent 38c9f98 commit f1471bc

File tree

2 files changed

+69
-13
lines changed

2 files changed

+69
-13
lines changed

drivers/regulator/Kconfig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,11 +1590,16 @@ config REGULATOR_TPS65219
15901590
tristate "TI TPS65219 Power regulators"
15911591
depends on MFD_TPS65219 && OF
15921592
help
1593-
This driver supports TPS65219 series and TPS65215 voltage regulator chips.
1593+
This driver supports TPS65219, TPS65215, and TPS65214 voltage
1594+
regulator chips.
15941595
TPS65219 series of PMICs have 3 single phase BUCKs & 4 LDOs
15951596
voltage regulators.
15961597
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.
15981603

15991604
config REGULATOR_TPS6594
16001605
tristate "TI TPS6594 Power regulators"

drivers/regulator/tps65219-regulator.c

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
//
3-
// Regulator driver for TPS65215/TPS65219 PMIC
3+
// TPS65214/TPS65215/TPS65219 PMIC Regulator Driver
44
//
55
// Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/
66
// Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
@@ -29,6 +29,11 @@ struct tps65219_regulator_irq_type {
2929
unsigned long event;
3030
};
3131

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+
3237
static struct tps65219_regulator_irq_type tps65219_regulator_irq_types[] = {
3338
{ "LDO3_SCG", "LDO3", "short circuit to ground", REGULATOR_EVENT_REGULATION_OUT },
3439
{ "LDO3_OC", "LDO3", "overcurrent", REGULATOR_EVENT_OVER_CURRENT },
@@ -40,9 +45,11 @@ static struct tps65219_regulator_irq_type tps65219_regulator_irq_types[] = {
4045
{ "LDO4_RV", "LDO4", "residual voltage", REGULATOR_EVENT_OVER_VOLTAGE_WARN },
4146
{ "LDO3_RV_SD", "LDO3", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN },
4247
{ "LDO4_RV_SD", "LDO4", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN },
48+
{ "SENSOR_3_WARM", "SENSOR3", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN},
49+
{ "SENSOR_3_HOT", "SENSOR3", "hot temperature", REGULATOR_EVENT_OVER_TEMP},
4350
};
4451

45-
/* All of TPS65215's irq types are the same as common_regulator_irq_types */
52+
/* All of TPS65214's irq types are the same as common_regulator_irq_types */
4653
static struct tps65219_regulator_irq_type common_regulator_irq_types[] = {
4754
{ "LDO1_SCG", "LDO1", "short circuit to ground", REGULATOR_EVENT_REGULATION_OUT },
4855
{ "LDO1_OC", "LDO1", "overcurrent", REGULATOR_EVENT_OVER_CURRENT },
@@ -75,11 +82,9 @@ static struct tps65219_regulator_irq_type common_regulator_irq_types[] = {
7582
REGULATOR_EVENT_OVER_VOLTAGE_WARN },
7683
{ "LDO1_RV_SD", "LDO1", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN },
7784
{ "LDO2_RV_SD", "LDO2", "residual voltage on shutdown", REGULATOR_EVENT_OVER_VOLTAGE_WARN },
78-
{ "SENSOR_3_WARM", "SENSOR3", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN},
7985
{ "SENSOR_2_WARM", "SENSOR2", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN },
8086
{ "SENSOR_1_WARM", "SENSOR1", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN },
8187
{ "SENSOR_0_WARM", "SENSOR0", "warm temperature", REGULATOR_EVENT_OVER_TEMP_WARN },
82-
{ "SENSOR_3_HOT", "SENSOR3", "hot temperature", REGULATOR_EVENT_OVER_TEMP},
8388
{ "SENSOR_2_HOT", "SENSOR2", "hot temperature", REGULATOR_EVENT_OVER_TEMP },
8489
{ "SENSOR_1_HOT", "SENSOR1", "hot temperature", REGULATOR_EVENT_OVER_TEMP },
8590
{ "SENSOR_0_HOT", "SENSOR0", "hot temperature", REGULATOR_EVENT_OVER_TEMP },
@@ -133,6 +138,12 @@ static const struct linear_range ldo_1_range[] = {
133138
REGULATOR_LINEAR_RANGE(3400000, 0x38, 0x3f, 0),
134139
};
135140

141+
static const struct linear_range tps65214_ldo_1_2_range[] = {
142+
REGULATOR_LINEAR_RANGE(600000, 0x0, 0x2, 0),
143+
REGULATOR_LINEAR_RANGE(650000, 0x3, 0x37, 50000),
144+
REGULATOR_LINEAR_RANGE(3300000, 0x38, 0x3F, 0),
145+
};
146+
136147
static const struct linear_range tps65215_ldo_2_range[] = {
137148
REGULATOR_LINEAR_RANGE(1200000, 0x0, 0xC, 50000),
138149
REGULATOR_LINEAR_RANGE(3300000, 0x36, 0x3F, 0),
@@ -251,17 +262,39 @@ static const struct regulator_desc common_regs[] = {
251262
TPS65219_REG_ENABLE_CTRL,
252263
TPS65219_ENABLE_BUCK3_EN_MASK, 0, 0, bucks_ranges,
253264
3, 0, 0, NULL, 0, 0),
265+
};
266+
267+
static const struct regulator_desc tps65214_regs[] = {
268+
// TPS65214's LDO3 pin maps to TPS65219's LDO3 pin
269+
TPS65219_REGULATOR("LDO1", "ldo1", TPS65214_LDO_1,
270+
REGULATOR_VOLTAGE, ldos_3_4_ops, 64,
271+
TPS65214_REG_LDO1_VOUT,
272+
TPS65219_BUCKS_LDOS_VOUT_VSET_MASK,
273+
TPS65219_REG_ENABLE_CTRL,
274+
TPS65219_ENABLE_LDO3_EN_MASK, 0, 0, tps65214_ldo_1_2_range,
275+
3, 0, 0, NULL, 0, 0),
276+
TPS65219_REGULATOR("LDO2", "ldo2", TPS65214_LDO_2,
277+
REGULATOR_VOLTAGE, ldos_3_4_ops, 64,
278+
TPS65214_REG_LDO2_VOUT,
279+
TPS65219_BUCKS_LDOS_VOUT_VSET_MASK,
280+
TPS65219_REG_ENABLE_CTRL,
281+
TPS65219_ENABLE_LDO2_EN_MASK, 0, 0, tps65214_ldo_1_2_range,
282+
3, 0, 0, NULL, 0, 0),
283+
};
284+
285+
static const struct regulator_desc tps65215_regs[] = {
286+
/*
287+
* TPS65215's LDO1 is the same as TPS65219's LDO1. LDO1 is
288+
* configurable as load switch and bypass-mode.
289+
* TPS65215's LDO2 is the same as TPS65219's LDO3
290+
*/
254291
TPS65219_REGULATOR("LDO1", "ldo1", TPS65219_LDO_1,
255292
REGULATOR_VOLTAGE, ldos_1_2_ops, 64,
256293
TPS65219_REG_LDO1_VOUT,
257294
TPS65219_BUCKS_LDOS_VOUT_VSET_MASK,
258295
TPS65219_REG_ENABLE_CTRL,
259296
TPS65219_ENABLE_LDO1_EN_MASK, 0, 0, ldo_1_range,
260297
2, 0, 0, NULL, 0, TPS65219_LDOS_BYP_CONFIG_MASK),
261-
};
262-
263-
static const struct regulator_desc tps65215_regs[] = {
264-
// TPS65215's LDO2 is the same as TPS65219's LDO3
265298
TPS65219_REGULATOR("LDO2", "ldo2", TPS65215_LDO_2,
266299
REGULATOR_VOLTAGE, ldos_3_4_ops, 64,
267300
TPS65215_REG_LDO2_VOUT,
@@ -272,6 +305,13 @@ static const struct regulator_desc tps65215_regs[] = {
272305
};
273306

274307
static const struct regulator_desc tps65219_regs[] = {
308+
TPS65219_REGULATOR("LDO1", "ldo1", TPS65219_LDO_1,
309+
REGULATOR_VOLTAGE, ldos_1_2_ops, 64,
310+
TPS65219_REG_LDO1_VOUT,
311+
TPS65219_BUCKS_LDOS_VOUT_VSET_MASK,
312+
TPS65219_REG_ENABLE_CTRL,
313+
TPS65219_ENABLE_LDO1_EN_MASK, 0, 0, ldo_1_range,
314+
2, 0, 0, NULL, 0, TPS65219_LDOS_BYP_CONFIG_MASK),
275315
TPS65219_REGULATOR("LDO2", "ldo2", TPS65219_LDO_2,
276316
REGULATOR_VOLTAGE, ldos_1_2_ops, 64,
277317
TPS65219_REG_LDO2_VOUT,
@@ -326,13 +366,23 @@ struct tps65219_chip_data {
326366
};
327367

328368
static struct tps65219_chip_data chip_info_table[] = {
369+
[TPS65214] = {
370+
.rdesc = tps65214_regs,
371+
.rdesc_size = ARRAY_SIZE(tps65214_regs),
372+
.common_rdesc = common_regs,
373+
.common_rdesc_size = ARRAY_SIZE(common_regs),
374+
.irq_types = NULL,
375+
.dev_irq_size = 0,
376+
.common_irq_types = common_regulator_irq_types,
377+
.common_irq_size = ARRAY_SIZE(common_regulator_irq_types),
378+
},
329379
[TPS65215] = {
330380
.rdesc = tps65215_regs,
331381
.rdesc_size = ARRAY_SIZE(tps65215_regs),
332382
.common_rdesc = common_regs,
333383
.common_rdesc_size = ARRAY_SIZE(common_regs),
334-
.irq_types = NULL,
335-
.dev_irq_size = 0,
384+
.irq_types = tps65215_regulator_irq_types,
385+
.dev_irq_size = ARRAY_SIZE(tps65215_regulator_irq_types),
336386
.common_irq_types = common_regulator_irq_types,
337387
.common_irq_size = ARRAY_SIZE(common_regulator_irq_types),
338388
},
@@ -436,6 +486,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
436486
}
437487

438488
static const struct platform_device_id tps65219_regulator_id_table[] = {
489+
{ "tps65214-regulator", TPS65214 },
439490
{ "tps65215-regulator", TPS65215 },
440491
{ "tps65219-regulator", TPS65219 },
441492
{ /* sentinel */ }
@@ -454,5 +505,5 @@ static struct platform_driver tps65219_regulator_driver = {
454505
module_platform_driver(tps65219_regulator_driver);
455506

456507
MODULE_AUTHOR("Jerome Neanne <j-neanne@baylibre.com>");
457-
MODULE_DESCRIPTION("TPS65215/TPS65219 voltage regulator driver");
508+
MODULE_DESCRIPTION("TPS65214/TPS65215/TPS65219 Regulator driver");
458509
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)