Add TI TPS65214 PMIC MFD Support
Subsystems (2)
cover Add TI TPS65214 PMIC MFD Support
TPS65214 is a Power Management Integrated Circuit (PMIC) that has significant register map overlap with TPS65215 and TPS65219. The series introduces TPS65214 and adds the device to the multi-PMIC support driver.
This follow-up series is dependent on:
Commit d23b7176df4a ("regulator: dt-bindings: Add TI TPS65214 PMIC bindings")
TPS65215 Driver Series:
GPIO: https://lore.kernel.org/all/[email protected]/
MFD: https://lore.kernel.org/all/[email protected]/
Reg: https://lore.kernel.org/all/[email protected]/
Input: https://lore.kernel.org/all/[email protected]/
TPS65219 Cleanup Series:
GPIO: https://lore.kernel.org/all/[email protected]/
MFD: https://lore.kernel.org/all/[email protected]/
Reg: https://lore.kernel.org/all/[email protected]/
- TPS65214 is a Power Management IC with 3 Buck regulators and 2 LDOs.
- TPS65214 has 2 LDOS and 1 GPO, whereas TPS65219 has 4 LDOs and 2 GPOs.
- TPS65214's LDO1 maps to TPS65219's LDO3.
- A key difference between TPS65215 & TPS65214 are the LDO current and voltage output ranges and the configurable options available.
- The remaining features for both devices are the same.
TPS65214 TRM: https://www.ti.com/lit/pdf/slvud30
AM62L + TPS65214 Test Logs:
https://gist.github.com/ramamoorthyhs/0793f7813332d94423ca1baee02f62c9
Shree Ramamoorthy (1):
mfd: tps65214: Add support for TI TPS65214 PMIC
drivers/mfd/tps65219.c | 126 ++++++++++++++++++++++++++++++++++- include/linux/mfd/tps65219.h | 65 ++++++++++++++++-- 2 files changed, 184 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/1 mfd: tps65214: Add support for TI TPS65214 PMIC
Use chip ID and chip_data struct to differentiate between 3 PMIC devices in probe(). Add TPS65214 resource information. Update descriptions and copyright information to reflect the driver supports 3 PMIC devices.
--- drivers/mfd/tps65219.c | 126 ++++++++++++++++++++++++++++++++++- include/linux/mfd/tps65219.h | 65 ++++++++++++++++-- 2 files changed, 184 insertions(+), 7 deletions(-)
drivers/mfd/tps65219.c +124 -2
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 // -// Driver for TPS65215/TPS65219 Power Management Integrated Chips (PMIC) +// Driver for TPS65214/TPS65215/TPS65219 Power Management Integrated Chips // // Copyright (C) 2022 BayLibre Incorporated - https://www.baylibre.com/ // Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
@@ -60,6 +60,44 @@ static const struct resource tps65219_pwrbutton_resources[] = { DEFINE_RES_IRQ_NAMED(TPS65219_INT_PB_RISING_EDGE_DETECT, "rising"), }; +static const struct resource tps65214_regulator_resources[] = { +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_SCG ,"LDO1_SCG" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_OC ,"LDO1_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_UV ,"LDO1_UV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_SCG ,"LDO2_SCG" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_OC ,"LDO2_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_UV ,"LDO2_UV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_SCG ,"BUCK3_SCG" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_OC ,"BUCK3_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_NEG_OC ,"BUCK3_NEG_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_UV ,"BUCK3_UV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_SCG ,"BUCK1_SCG" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_OC ,"BUCK1_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_NEG_OC ,"BUCK1_NEG_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_UV ,"BUCK1_UV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_SCG ,"BUCK2_SCG" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_OC ,"BUCK2_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_NEG_OC ,"BUCK2_NEG_OC" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_UV ,"BUCK2_UV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_RV ,"BUCK1_RV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_RV ,"BUCK2_RV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_RV ,"BUCK3_RV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO1_RV ,"LDO1_RV" ), +DEFINE_RES_IRQ_NAMED (TPS65214_INT_LDO2_RV ,"LDO2_RV" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK1_RV_SD ,"BUCK1_RV_SD" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK2_RV_SD ,"BUCK2_RV_SD" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_BUCK3_RV_SD ,"BUCK3_RV_SD" ), +DEFINE_RES_IRQ_NAMED (TPS65214_INT_LDO1_RV_SD ,"LDO1_RV_SD" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_LDO2_RV_SD ,"LDO2_RV_SD" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_TIMEOUT ,"TIMEOUT" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_2_WARM ,"SENSOR_2_WARM" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_1_WARM ,"SENSOR_1_WARM" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_0_WARM ,"SENSOR_0_WARM" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_2_HOT ,"SENSOR_2_HOT" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_1_HOT ,"SENSOR_1_HOT" ), +DEFINE_RES_IRQ_NAMED (TPS65219_INT_SENSOR_0_HOT ,"SENSOR_0_HOT" ), +}; +static const struct resource tps65215_regulator_resources[] = {DEFINE_RES_IRQ_NAMED (TPS65215_INT_LDO1_SCG ,"LDO1_SCG" ),DEFINE_RES_IRQ_NAMED (TPS65215_INT_LDO1_OC ,"LDO1_OC" ),
@@ -150,6 +188,11 @@ static const struct resource tps65219_regulator_resources[] = { DEFINE_RES_IRQ_NAMED(TPS65219_INT_SENSOR_0_HOT, "SENSOR_0_HOT"), }; +static const struct mfd_cell tps65214_cells[] = { +MFD_CELL_RES ("tps65214-regulator" , tps65214_regulator_resources), +MFD_CELL_NAME ("tps65214-gpio" ), +}; +static const struct mfd_cell tps65215_cells[] = {MFD_CELL_RES ("tps65215-regulator" , tps65215_regulator_resources),MFD_CELL_NAME ("tps65215-gpio" ),
@@ -186,6 +229,15 @@ static unsigned int tps65215_bit5_offsets[] = { TPS65215_REG_INT_LDO_1_POS };static unsigned int tps65215_bit6_offsets[] = {TPS65215_REG_INT_LDO_2_POS };static unsigned int bit7_offsets[] = {TPS65219_REG_INT_PB_POS };/* Power Button */ +/* TPS65214 INT_SOURCE bit 6 is 'RESERVED'*/ +static unsigned int tps65214_bit0_offsets[] = {TPS65214_REG_INT_TO_RV_POS }; +static unsigned int tps65214_bit1_offsets[] = {TPS65214_REG_INT_RV_POS }; +static unsigned int tps65214_bit2_offsets[] = {TPS65214_REG_INT_SYS_POS }; +static unsigned int tps65214_bit3_offsets[] = {TPS65214_REG_INT_BUCK_1_2_POS }; +static unsigned int tps65214_bit4_offsets[] = {TPS65214_REG_INT_BUCK_3_POS }; +static unsigned int tps65214_bit5_offsets[] = {TPS65214_REG_INT_LDO_1_2_POS }; +static unsigned int tps65214_bit7_offsets[] = {TPS65214_REG_INT_PB_POS }; +static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = {REGMAP_IRQ_MAIN_REG_OFFSET (bit0_offsets),REGMAP_IRQ_MAIN_REG_OFFSET (bit1_offsets),
@@ -208,9 +260,59 @@ static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), }; +static struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets[] = { +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit0_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit1_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit2_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit3_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit4_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit5_offsets), +REGMAP_IRQ_MAIN_REG_OFFSET (tps65214_bit7_offsets), +}; +#define TPS65219_REGMAP_IRQ_REG (int_name, register_position) \ REGMAP_IRQ_REG(int_name, register_position, int_name##_MASK) +static const struct regmap_irq tps65214_irqs[] = { +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_SCG ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_OC ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_UV ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_SCG ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_OC ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_UV ,TPS65214_REG_INT_LDO_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_SCG ,TPS65214_REG_INT_BUCK_3_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_OC ,TPS65214_REG_INT_BUCK_3_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_NEG_OC ,TPS65214_REG_INT_BUCK_3_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_UV ,TPS65214_REG_INT_BUCK_3_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_SCG ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_OC ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_NEG_OC ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_UV ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_SCG ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_OC ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_NEG_OC ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_UV ,TPS65214_REG_INT_BUCK_1_2_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_2_WARM ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_1_WARM ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_0_WARM ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_2_HOT ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_1_HOT ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_SENSOR_0_HOT ,TPS65214_REG_INT_SYS_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_RV ,TPS65214_REG_INT_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_RV ,TPS65214_REG_INT_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_RV ,TPS65214_REG_INT_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO1_RV ,TPS65214_REG_INT_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65214_INT_LDO2_RV ,TPS65214_REG_INT_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK1_RV_SD ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK2_RV_SD ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_BUCK3_RV_SD ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65214_INT_LDO1_RV_SD ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_LDO2_RV_SD ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_TIMEOUT ,TPS65214_REG_INT_TO_RV_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_PB_FALLING_EDGE_DETECT ,TPS65214_REG_INT_PB_POS ), +TPS65219_REGMAP_IRQ_REG (TPS65219_INT_PB_RISING_EDGE_DETECT ,TPS65214_REG_INT_PB_POS ), +}; +static const struct regmap_irq tps65215_irqs[] = {TPS65219_REGMAP_IRQ_REG (TPS65215_INT_LDO1_SCG ,TPS65215_REG_INT_LDO_1_POS ),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[] = { TPS65219_REGMAP_IRQ_REG(TPS65219_INT_PB_RISING_EDGE_DETECT, TPS65219_REG_INT_PB_POS), }; +static const struct regmap_irq_chip tps65214_irq_chip = { + .name ="tps65214_irq" , + .main_status =TPS65219_REG_INT_SOURCE , + .num_main_regs =1 , + .num_main_status_bits =8 , + .irqs = tps65214_irqs, + .num_irqs =ARRAY_SIZE (tps65214_irqs), + .status_base =TPS65214_REG_INT_LDO_1_2 , + .ack_base =TPS65214_REG_INT_LDO_1_2 , + .clear_ack =1 , + .num_regs =8 , + .sub_reg_offsets = tps65214_sub_irq_offsets, +}; +static const struct regmap_irq_chip tps65215_irq_chip = { .name ="tps65215_irq" , .main_status =TPS65219_REG_INT_SOURCE ,
@@ -340,6 +456,11 @@ struct tps65219_chip_data { };static struct tps65219_chip_data chip_info_table[] = { + [TPS65214 ] = { + .irq_chip = &tps65214_irq_chip, + .cells = tps65214_cells, + .n_cells =ARRAY_SIZE (tps65214_cells), + }, [TPS65215 ] = { .irq_chip = &tps65215_irq_chip, .cells = tps65215_cells,
@@ -421,6 +542,7 @@ static int tps65219_probe(struct i2c_client *client) }static const struct of_device_id of_tps65219_match_table[] = { + { .compatible ="ti,tps65214" , .data = (void *)TPS65214 , }, { .compatible ="ti,tps65215" , .data = (void *)TPS65215 , }, { .compatible ="ti,tps65219" , .data = (void *)TPS65219 , }, {}
@@ -437,5 +559,5 @@ static struct i2c_driver tps65219_driver = {module_i2c_driver (tps65219_driver);MODULE_AUTHOR ("Jerome Neanne <[email protected]>" ); -MODULE_DESCRIPTION ("TPS65215/TPS65219 PMIC driver" ); +MODULE_DESCRIPTION ("TPS65214/TPS65215/TPS65219 PMIC driver" );MODULE_LICENSE ("GPL" );
include/linux/mfd/tps65219.h +60 -5
188 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v1 1/1] mfd: tps65214: Add support for TI TPS65214 PMIC
Quoted 17 lines · Shree Ramamoorthy
Use chip ID and
chip_datastruct to differentiate between 3 PMIC devices inprobe(). Add TPS65214 resource information. Update descriptions and copyright information to reflect the driver supports 3 PMIC devices.Signed-off-by Shree Ramamoorthy <[email protected]>---
static struct
tps65219_chip_datachip_info_table[] = {drivers/mfd/tps65219.c +5
-0+ [TPS65214] = { + .irq_chip = &tps65214_irq_chip, + .cells = tps65214_cells, + .n_cells = ARRAY_SIZE(tps65214_cells), + }, [TPS65215] = { .irq_chip = &tps65215_irq_chip, .cells = tps65215_cells,
drivers/mfd/tps65219.c static int tps65219_probe(struct i2c_client *client) · line 545
Quoted 4 lines
drivers/mfd/tps65219.c +1
-0@@ -421,6 +542,7 @@ static int tps65219_probe(struct i2c_client *client) }static const struct of_device_id of_tps65219_match_table[] = { + { .compatible ="ti,tps65214" , .data = (void *)TPS65214 , },
Where is the binding patch? It cannot be sent separately.
drivers/mfd/tps65219.c static int tps65219_probe(struct i2c_client *client) · line 547
Quoted 2 lines
drivers/mfd/tps65219.c +0
-0{ .compatible = "ti,tps65215", .data = (void *)TPS65215, }, { .compatible = "ti,tps65219", .data = (void *)TPS65219, },
Best regards,
Krzysztof
Quoted 6 lines · Shree Ramamoorthy
TPS65214 is a Power Management Integrated Circuit (PMIC) that has significant register map overlap with TPS65215 and TPS65219. The series introduces TPS65214 and adds the device to the multi-PMIC support driver.
This follow-up series is dependent on:
Commitd23b7176df4a("regulator: dt-bindings: Add TI TPS65214 PMIC bindings")
What is this commit? Which tree? Recent next does not have it.
The other thread said it depends on this patch, so how do you see it being merged? A depends on B, B depends on A. If A gets merged first:
broken kernel. If B gets merged first: broken kernel? So what does this dependency and commit even mean?
Best regards,
Krzysztof