1
1
// SPDX-License-Identifier: GPL-2.0
2
2
//
3
- // Driver for TPS65215/TPS65219 Power Management Integrated Chips (PMIC)
3
+ // Driver for TPS65214/ TPS65215/TPS65219 Power Management Integrated Chips
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/
@@ -60,6 +60,44 @@ static const struct resource tps65219_pwrbutton_resources[] = {
60
60
DEFINE_RES_IRQ_NAMED (TPS65219_INT_PB_RISING_EDGE_DETECT , "rising" ),
61
61
};
62
62
63
+ static const struct resource tps65214_regulator_resources [] = {
64
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_SCG , "LDO1_SCG" ),
65
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_OC , "LDO1_OC" ),
66
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_UV , "LDO1_UV" ),
67
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_SCG , "LDO2_SCG" ),
68
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_OC , "LDO2_OC" ),
69
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_UV , "LDO2_UV" ),
70
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_SCG , "BUCK3_SCG" ),
71
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_OC , "BUCK3_OC" ),
72
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_NEG_OC , "BUCK3_NEG_OC" ),
73
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_UV , "BUCK3_UV" ),
74
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_SCG , "BUCK1_SCG" ),
75
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_OC , "BUCK1_OC" ),
76
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_NEG_OC , "BUCK1_NEG_OC" ),
77
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_UV , "BUCK1_UV" ),
78
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_SCG , "BUCK2_SCG" ),
79
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_OC , "BUCK2_OC" ),
80
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_NEG_OC , "BUCK2_NEG_OC" ),
81
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_UV , "BUCK2_UV" ),
82
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_RV , "BUCK1_RV" ),
83
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_RV , "BUCK2_RV" ),
84
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_RV , "BUCK3_RV" ),
85
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_RV , "LDO1_RV" ),
86
+ DEFINE_RES_IRQ_NAMED (TPS65214_INT_LDO2_RV , "LDO2_RV" ),
87
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_RV_SD , "BUCK1_RV_SD" ),
88
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_RV_SD , "BUCK2_RV_SD" ),
89
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_RV_SD , "BUCK3_RV_SD" ),
90
+ DEFINE_RES_IRQ_NAMED (TPS65214_INT_LDO1_RV_SD , "LDO1_RV_SD" ),
91
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_RV_SD , "LDO2_RV_SD" ),
92
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_TIMEOUT , "TIMEOUT" ),
93
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_2_WARM , "SENSOR_2_WARM" ),
94
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_1_WARM , "SENSOR_1_WARM" ),
95
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_0_WARM , "SENSOR_0_WARM" ),
96
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_2_HOT , "SENSOR_2_HOT" ),
97
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_1_HOT , "SENSOR_1_HOT" ),
98
+ DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_0_HOT , "SENSOR_0_HOT" ),
99
+ };
100
+
63
101
static const struct resource tps65215_regulator_resources [] = {
64
102
DEFINE_RES_IRQ_NAMED (TPS65215_INT_LDO1_SCG , "LDO1_SCG" ),
65
103
DEFINE_RES_IRQ_NAMED (TPS65215_INT_LDO1_OC , "LDO1_OC" ),
@@ -150,6 +188,11 @@ static const struct resource tps65219_regulator_resources[] = {
150
188
DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_0_HOT , "SENSOR_0_HOT" ),
151
189
};
152
190
191
+ static const struct mfd_cell tps65214_cells [] = {
192
+ MFD_CELL_RES ("tps65214-regulator" , tps65214_regulator_resources ),
193
+ MFD_CELL_NAME ("tps65215-gpio" ),
194
+ };
195
+
153
196
static const struct mfd_cell tps65215_cells [] = {
154
197
MFD_CELL_RES ("tps65215-regulator" , tps65215_regulator_resources ),
155
198
MFD_CELL_NAME ("tps65215-gpio" ),
@@ -186,6 +229,15 @@ static unsigned int tps65215_bit5_offsets[] = { TPS65215_REG_INT_LDO_1_POS };
186
229
static unsigned int tps65215_bit6_offsets [] = { TPS65215_REG_INT_LDO_2_POS };
187
230
static unsigned int bit7_offsets [] = { TPS65219_REG_INT_PB_POS }; /* Power Button */
188
231
232
+ /* TPS65214 INT_SOURCE bit 6 is 'RESERVED'*/
233
+ static unsigned int tps65214_bit0_offsets [] = { TPS65214_REG_INT_TO_RV_POS };
234
+ static unsigned int tps65214_bit1_offsets [] = { TPS65214_REG_INT_RV_POS };
235
+ static unsigned int tps65214_bit2_offsets [] = { TPS65214_REG_INT_SYS_POS };
236
+ static unsigned int tps65214_bit3_offsets [] = { TPS65214_REG_INT_BUCK_1_2_POS };
237
+ static unsigned int tps65214_bit4_offsets [] = { TPS65214_REG_INT_BUCK_3_POS };
238
+ static unsigned int tps65214_bit5_offsets [] = { TPS65214_REG_INT_LDO_1_2_POS };
239
+ static unsigned int tps65214_bit7_offsets [] = { TPS65214_REG_INT_PB_POS };
240
+
189
241
static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets [] = {
190
242
REGMAP_IRQ_MAIN_REG_OFFSET (bit0_offsets ),
191
243
REGMAP_IRQ_MAIN_REG_OFFSET (bit1_offsets ),
@@ -208,9 +260,59 @@ static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = {
208
260
REGMAP_IRQ_MAIN_REG_OFFSET (bit7_offsets ),
209
261
};
210
262
263
+ static struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets [] = {
264
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit0_offsets ),
265
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit1_offsets ),
266
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit2_offsets ),
267
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit3_offsets ),
268
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit4_offsets ),
269
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit5_offsets ),
270
+ REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit7_offsets ),
271
+ };
272
+
211
273
#define TPS65219_REGMAP_IRQ_REG (int_name , register_position ) \
212
274
REGMAP_IRQ_REG(int_name, register_position, int_name##_MASK)
213
275
276
+ static const struct regmap_irq tps65214_irqs [] = {
277
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_SCG , TPS65214_REG_INT_LDO_1_2_POS ),
278
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_OC , TPS65214_REG_INT_LDO_1_2_POS ),
279
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_UV , TPS65214_REG_INT_LDO_1_2_POS ),
280
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_SCG , TPS65214_REG_INT_LDO_1_2_POS ),
281
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_OC , TPS65214_REG_INT_LDO_1_2_POS ),
282
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_UV , TPS65214_REG_INT_LDO_1_2_POS ),
283
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_SCG , TPS65214_REG_INT_BUCK_3_POS ),
284
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_OC , TPS65214_REG_INT_BUCK_3_POS ),
285
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_NEG_OC , TPS65214_REG_INT_BUCK_3_POS ),
286
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_UV , TPS65214_REG_INT_BUCK_3_POS ),
287
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_SCG , TPS65214_REG_INT_BUCK_1_2_POS ),
288
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_OC , TPS65214_REG_INT_BUCK_1_2_POS ),
289
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_NEG_OC , TPS65214_REG_INT_BUCK_1_2_POS ),
290
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_UV , TPS65214_REG_INT_BUCK_1_2_POS ),
291
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_SCG , TPS65214_REG_INT_BUCK_1_2_POS ),
292
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_OC , TPS65214_REG_INT_BUCK_1_2_POS ),
293
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_NEG_OC , TPS65214_REG_INT_BUCK_1_2_POS ),
294
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_UV , TPS65214_REG_INT_BUCK_1_2_POS ),
295
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_2_WARM , TPS65214_REG_INT_SYS_POS ),
296
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_1_WARM , TPS65214_REG_INT_SYS_POS ),
297
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_0_WARM , TPS65214_REG_INT_SYS_POS ),
298
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_2_HOT , TPS65214_REG_INT_SYS_POS ),
299
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_1_HOT , TPS65214_REG_INT_SYS_POS ),
300
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_0_HOT , TPS65214_REG_INT_SYS_POS ),
301
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_RV , TPS65214_REG_INT_RV_POS ),
302
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_RV , TPS65214_REG_INT_RV_POS ),
303
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_RV , TPS65214_REG_INT_RV_POS ),
304
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_RV , TPS65214_REG_INT_RV_POS ),
305
+ TPS65219_REGMAP_IRQ_REG (TPS65214_INT_LDO2_RV , TPS65214_REG_INT_RV_POS ),
306
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_RV_SD , TPS65214_REG_INT_TO_RV_POS ),
307
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_RV_SD , TPS65214_REG_INT_TO_RV_POS ),
308
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_RV_SD , TPS65214_REG_INT_TO_RV_POS ),
309
+ TPS65219_REGMAP_IRQ_REG (TPS65214_INT_LDO1_RV_SD , TPS65214_REG_INT_TO_RV_POS ),
310
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_RV_SD , TPS65214_REG_INT_TO_RV_POS ),
311
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_TIMEOUT , TPS65214_REG_INT_TO_RV_POS ),
312
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_PB_FALLING_EDGE_DETECT , TPS65214_REG_INT_PB_POS ),
313
+ TPS65219_REGMAP_IRQ_REG (TPS65219_INT_PB_RISING_EDGE_DETECT , TPS65214_REG_INT_PB_POS ),
314
+ };
315
+
214
316
static const struct regmap_irq tps65215_irqs [] = {
215
317
TPS65219_REGMAP_IRQ_REG (TPS65215_INT_LDO1_SCG , TPS65215_REG_INT_LDO_1_POS ),
216
318
TPS65219_REGMAP_IRQ_REG (TPS65215_INT_LDO1_OC , TPS65215_REG_INT_LDO_1_POS ),
@@ -305,6 +407,20 @@ static const struct regmap_irq tps65219_irqs[] = {
305
407
TPS65219_REGMAP_IRQ_REG (TPS65219_INT_PB_RISING_EDGE_DETECT , TPS65219_REG_INT_PB_POS ),
306
408
};
307
409
410
+ static const struct regmap_irq_chip tps65214_irq_chip = {
411
+ .name = "tps65214_irq" ,
412
+ .main_status = TPS65219_REG_INT_SOURCE ,
413
+ .num_main_regs = 1 ,
414
+ .num_main_status_bits = 8 ,
415
+ .irqs = tps65214_irqs ,
416
+ .num_irqs = ARRAY_SIZE (tps65214_irqs ),
417
+ .status_base = TPS65214_REG_INT_LDO_1_2 ,
418
+ .ack_base = TPS65214_REG_INT_LDO_1_2 ,
419
+ .clear_ack = 1 ,
420
+ .num_regs = 8 ,
421
+ .sub_reg_offsets = tps65214_sub_irq_offsets ,
422
+ };
423
+
308
424
static const struct regmap_irq_chip tps65215_irq_chip = {
309
425
.name = "tps65215_irq" ,
310
426
.main_status = TPS65219_REG_INT_SOURCE ,
@@ -340,6 +456,11 @@ struct tps65219_chip_data {
340
456
};
341
457
342
458
static struct tps65219_chip_data chip_info_table [] = {
459
+ [TPS65214 ] = {
460
+ .irq_chip = & tps65214_irq_chip ,
461
+ .cells = tps65214_cells ,
462
+ .n_cells = ARRAY_SIZE (tps65214_cells ),
463
+ },
343
464
[TPS65215 ] = {
344
465
.irq_chip = & tps65215_irq_chip ,
345
466
.cells = tps65215_cells ,
@@ -421,6 +542,7 @@ static int tps65219_probe(struct i2c_client *client)
421
542
}
422
543
423
544
static const struct of_device_id of_tps65219_match_table [] = {
545
+ { .compatible = "ti,tps65214" , .data = (void * )TPS65214 , },
424
546
{ .compatible = "ti,tps65215" , .data = (void * )TPS65215 , },
425
547
{ .compatible = "ti,tps65219" , .data = (void * )TPS65219 , },
426
548
{}
@@ -437,5 +559,5 @@ static struct i2c_driver tps65219_driver = {
437
559
module_i2c_driver (tps65219_driver );
438
560
439
561
MODULE_AUTHOR (
"Jerome Neanne <[email protected] >" );
440
- MODULE_DESCRIPTION ("TPS65215/TPS65219 PMIC driver" );
562
+ MODULE_DESCRIPTION ("TPS65214/ TPS65215/TPS65219 PMIC driver" );
441
563
MODULE_LICENSE ("GPL" );
0 commit comments