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+
3237static 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 */
4653static 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+
136147static 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
274307static 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
328368static 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
438488static 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 = {
454505module_platform_driver (tps65219_regulator_driver );
455506
456507MODULE_AUTHOR (
"Jerome Neanne <[email protected] >" );
457- MODULE_DESCRIPTION ("TPS65215/TPS65219 voltage regulator driver" );
508+ MODULE_DESCRIPTION ("TPS65214/ TPS65215/TPS65219 Regulator driver" );
458509MODULE_LICENSE ("GPL" );
0 commit comments