[PATCH 3/3] mfd: tps65219: Keep running past the warm threshold when asked

From: Chrispine Tinega

Date: Fri Nov 13 2026 - 22:26:55 EST


When the devicetree sets ti,no-warm-shutdown on a TPS65219, set the
four SENSOR_x_WARM_MASK bits in MASK_CONFIG at probe. The PMIC then
reports a warm die instead of powering the board down, and powers off
only at its hot threshold.

The masks are loaded from the PMIC's NVM at every power-up, so they are
set on every probe.

Signed-off-by: Chrispine Tinega <dev@xxxxxxxxxxxxxxxxxxx>
---
drivers/mfd/tps65219.c | 15 +++++++++++++++
include/linux/mfd/tps65219.h | 6 +++++-
2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
index e52fbf148..d8e352f35 100644
--- a/drivers/mfd/tps65219.c
+++ b/drivers/mfd/tps65219.c
@@ -507,6 +507,21 @@ static int tps65219_probe(struct i2c_client *client)
}
}

+ /*
+ * The warm masks are loaded from NVM at every power-up, so they are set
+ * again on every probe. With a sensor unmasked, the PMIC powers down at
+ * the warm threshold; with all masked, only at the hot threshold.
+ */
+ if (chip_id == TPS65219 &&
+ of_property_read_bool(tps->dev->of_node, "ti,no-warm-shutdown")) {
+ ret = regmap_set_bits(tps->regmap, TPS65219_REG_MASK_CONFIG,
+ TPS65219_REG_MASK_SENSOR_WARM_MASK);
+ if (ret) {
+ dev_err(tps->dev, "Failed to mask warm shutdown: %d\n", ret);
+ return ret;
+ }
+ }
+
ret = devm_regmap_add_irq_chip(tps->dev, tps->regmap, client->irq,
IRQF_ONESHOT, 0, pmic->irq_chip,
&tps->irq_data);
diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h
index 5a6be84e2..688173044 100644
--- a/include/linux/mfd/tps65219.h
+++ b/include/linux/mfd/tps65219.h
@@ -196,7 +196,11 @@ enum pmic_id {
#define TPS65219_REG_MASK_UV_BUCK3_UV_MASK BIT(6)
#define TPS65219_REG_MASK_UV_RETRY_MASK BIT(7)
/* MASK Config */
-// SENSOR_N_WARM_MASK already defined in Thermal
+#define TPS65219_REG_MASK_SENSOR_3_WARM_MASK BIT(0)
+#define TPS65219_REG_MASK_SENSOR_2_WARM_MASK BIT(1)
+#define TPS65219_REG_MASK_SENSOR_1_WARM_MASK BIT(2)
+#define TPS65219_REG_MASK_SENSOR_0_WARM_MASK BIT(3)
+#define TPS65219_REG_MASK_SENSOR_WARM_MASK GENMASK(3, 0)
#define TPS65219_REG_MASK_INT_FOR_RV_MASK BIT(4)
#define TPS65219_REG_MASK_EFFECT_MASK GENMASK(6, 5)
#define TPS65219_REG_MASK_INT_FOR_PB_MASK BIT(7)
--
2.53.0