[PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in probe function
From: Guenter Roeck
Date: Tue Jan 27 2026 - 18:32:32 EST
Instantiating the driver does not make sense if the temperature sensor
is disabled, so enable it unconditionally in the probe function.
If that fails, write operations to the chip are likely disabled
by the I2C controller. Bail out with an eror message if that happens.
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
drivers/hwmon/spd5118.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/hwmon/spd5118.c b/drivers/hwmon/spd5118.c
index 5da44571b6a0..3e0e780014f9 100644
--- a/drivers/hwmon/spd5118.c
+++ b/drivers/hwmon/spd5118.c
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
if (!spd5118_vendor_valid(bank, vendor))
return -ENODEV;
+ if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+ SPD5118_TS_DISABLE, 0) < 0)
+ return dev_err_probe(dev, -ENODEV,
+ "Failed to enable temperature sensor\n");
+
data->regmap = regmap;
mutex_init(&data->nvmem_lock);
dev_set_drvdata(dev, data);
--
2.45.2