[PATCH 3/6] iio: adc: ltc2497: add LTC2493 internal temperature channel

From: Andrei Stancovici via B4 Relay

Date: Fri Oct 09 2026 - 04:44:18 EST


From: Andrei Stancovici <andrei.stancovici@xxxxxxxxxx>

The LTC2493 includes the same internal PTAT temperature sensor as the
LTC2499, selected via the IM bit in the second config byte.

Tested on live LTC2493 hardware connected through an IIO network backend:
in_temp_raw, in_temp_scale, and in_temp_offset are readable; the reported
temperature is plausible; and voltage/temperature interleaving produces no
sticky-PTAT.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/2493fe.pdf
Signed-off-by: Andrei Stancovici <andrei.stancovici@xxxxxxxxxx>
---
drivers/iio/adc/ltc2497-core.c | 2 +-
drivers/iio/adc/ltc2497.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ltc2497-core.c b/drivers/iio/adc/ltc2497-core.c
index 96b365efd1e9..87eade46beb5 100644
--- a/drivers/iio/adc/ltc2497-core.c
+++ b/drivers/iio/adc/ltc2497-core.c
@@ -396,7 +396,7 @@ int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev)
indio_dev->channels = ltc2497core_channel;
indio_dev->num_channels = ARRAY_SIZE(ltc2497core_channel);
}
- /* Only the ltc2499 has a temperature channel; it is the last entry. */
+ /* Temperature is the last channel entry; trim it for parts without the sensor. */
if (!ddata->chip_info->has_temp)
indio_dev->num_channels--;

diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c
index ea9dff3c0d73..12c8a2fecc07 100644
--- a/drivers/iio/adc/ltc2497.c
+++ b/drivers/iio/adc/ltc2497.c
@@ -174,6 +174,7 @@ static const struct ltc2497_chip_info ltc2497_info[] = {
[TYPE_LTC2493] = {
.resolution = 24,
.name = "ltc2493",
+ .has_temp = true,
.four_channel = true,
},
[TYPE_LTC2497] = {

--
2.43.0