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,6 +29,11 @@ struct tps65219_regulator_irq_type {
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 },
@@ -40,9 +45,11 @@ static struct tps65219_regulator_irq_type tps65219_regulator_irq_types[] = {
40
45
{ "LDO4_RV" , "LDO4" , "residual voltage" , REGULATOR_EVENT_OVER_VOLTAGE_WARN },
41
46
{ "LDO3_RV_SD" , "LDO3" , "residual voltage on shutdown" , REGULATOR_EVENT_OVER_VOLTAGE_WARN },
42
47
{ "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 },
43
50
};
44
51
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 */
46
53
static struct tps65219_regulator_irq_type common_regulator_irq_types [] = {
47
54
{ "LDO1_SCG" , "LDO1" , "short circuit to ground" , REGULATOR_EVENT_REGULATION_OUT },
48
55
{ "LDO1_OC" , "LDO1" , "overcurrent" , REGULATOR_EVENT_OVER_CURRENT },
@@ -75,11 +82,9 @@ static struct tps65219_regulator_irq_type common_regulator_irq_types[] = {
75
82
REGULATOR_EVENT_OVER_VOLTAGE_WARN },
76
83
{ "LDO1_RV_SD" , "LDO1" , "residual voltage on shutdown" , REGULATOR_EVENT_OVER_VOLTAGE_WARN },
77
84
{ "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 },
79
85
{ "SENSOR_2_WARM" , "SENSOR2" , "warm temperature" , REGULATOR_EVENT_OVER_TEMP_WARN },
80
86
{ "SENSOR_1_WARM" , "SENSOR1" , "warm temperature" , REGULATOR_EVENT_OVER_TEMP_WARN },
81
87
{ "SENSOR_0_WARM" , "SENSOR0" , "warm temperature" , REGULATOR_EVENT_OVER_TEMP_WARN },
82
- { "SENSOR_3_HOT" , "SENSOR3" , "hot temperature" , REGULATOR_EVENT_OVER_TEMP },
83
88
{ "SENSOR_2_HOT" , "SENSOR2" , "hot temperature" , REGULATOR_EVENT_OVER_TEMP },
84
89
{ "SENSOR_1_HOT" , "SENSOR1" , "hot temperature" , REGULATOR_EVENT_OVER_TEMP },
85
90
{ "SENSOR_0_HOT" , "SENSOR0" , "hot temperature" , REGULATOR_EVENT_OVER_TEMP },
@@ -133,6 +138,12 @@ static const struct linear_range ldo_1_range[] = {
133
138
REGULATOR_LINEAR_RANGE (3400000 , 0x38 , 0x3f , 0 ),
134
139
};
135
140
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
+
136
147
static const struct linear_range tps65215_ldo_2_range [] = {
137
148
REGULATOR_LINEAR_RANGE (1200000 , 0x0 , 0xC , 50000 ),
138
149
REGULATOR_LINEAR_RANGE (3300000 , 0x36 , 0x3F , 0 ),
@@ -251,17 +262,39 @@ static const struct regulator_desc common_regs[] = {
251
262
TPS65219_REG_ENABLE_CTRL ,
252
263
TPS65219_ENABLE_BUCK3_EN_MASK , 0 , 0 , bucks_ranges ,
253
264
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
+ */
254
291
TPS65219_REGULATOR ("LDO1" , "ldo1" , TPS65219_LDO_1 ,
255
292
REGULATOR_VOLTAGE , ldos_1_2_ops , 64 ,
256
293
TPS65219_REG_LDO1_VOUT ,
257
294
TPS65219_BUCKS_LDOS_VOUT_VSET_MASK ,
258
295
TPS65219_REG_ENABLE_CTRL ,
259
296
TPS65219_ENABLE_LDO1_EN_MASK , 0 , 0 , ldo_1_range ,
260
297
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
265
298
TPS65219_REGULATOR ("LDO2" , "ldo2" , TPS65215_LDO_2 ,
266
299
REGULATOR_VOLTAGE , ldos_3_4_ops , 64 ,
267
300
TPS65215_REG_LDO2_VOUT ,
@@ -272,6 +305,13 @@ static const struct regulator_desc tps65215_regs[] = {
272
305
};
273
306
274
307
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 ),
275
315
TPS65219_REGULATOR ("LDO2" , "ldo2" , TPS65219_LDO_2 ,
276
316
REGULATOR_VOLTAGE , ldos_1_2_ops , 64 ,
277
317
TPS65219_REG_LDO2_VOUT ,
@@ -326,13 +366,23 @@ struct tps65219_chip_data {
326
366
};
327
367
328
368
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
+ },
329
379
[TPS65215 ] = {
330
380
.rdesc = tps65215_regs ,
331
381
.rdesc_size = ARRAY_SIZE (tps65215_regs ),
332
382
.common_rdesc = common_regs ,
333
383
.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 ) ,
336
386
.common_irq_types = common_regulator_irq_types ,
337
387
.common_irq_size = ARRAY_SIZE (common_regulator_irq_types ),
338
388
},
@@ -436,6 +486,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
436
486
}
437
487
438
488
static const struct platform_device_id tps65219_regulator_id_table [] = {
489
+ { "tps65214-regulator" , TPS65214 },
439
490
{ "tps65215-regulator" , TPS65215 },
440
491
{ "tps65219-regulator" , TPS65219 },
441
492
{ /* sentinel */ }
@@ -454,5 +505,5 @@ static struct platform_driver tps65219_regulator_driver = {
454
505
module_platform_driver (tps65219_regulator_driver );
455
506
456
507
MODULE_AUTHOR ("Jerome Neanne <j-neanne@baylibre.com>" );
457
- MODULE_DESCRIPTION ("TPS65215/TPS65219 voltage regulator driver" );
508
+ MODULE_DESCRIPTION ("TPS65214/ TPS65215/TPS65219 Regulator driver" );
458
509
MODULE_LICENSE ("GPL" );
0 commit comments