[PATCH 4/6] iio: adc: ltc2497: add 2x speed mode support for the LTC2493
From: Andrei Stancovici via B4 Relay
Date: Fri Oct 09 2026 - 04:44:00 EST
From: Andrei Stancovici <andrei.stancovici@xxxxxxxxxx>
The LTC2493 supports the same SPD 2x conversion-speed mode as the
LTC2499, using the same config word and conversion times. Expose it
through sampling_frequency and sampling_frequency_available on the
voltage channels. The temperature channel ignores the mode and carries
no sampling_frequency.
Tested on live LTC2493 hardware connected through an IIO network
backend: 1x/2x switching works, voltage reads succeed at both rates, and
the temperature channel carries no sampling_frequency attribute.
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 | 6 +++++-
drivers/iio/adc/ltc2497.c | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ltc2497-core.c b/drivers/iio/adc/ltc2497-core.c
index 87eade46beb5..816312bf0e90 100644
--- a/drivers/iio/adc/ltc2497-core.c
+++ b/drivers/iio/adc/ltc2497-core.c
@@ -362,6 +362,7 @@ static const struct iio_chan_spec _name[] = { \
}
LTC2493_DEFINE_CHANNELS(ltc2493_channel, 0);
+LTC2493_DEFINE_CHANNELS(ltc2493_channel_samp_freq, BIT(IIO_CHAN_INFO_SAMP_FREQ));
static const struct iio_info ltc2497core_info = {
.read_raw = ltc2497core_read_raw,
@@ -387,7 +388,10 @@ int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev)
indio_dev->info = <c2497core_info;
indio_dev->modes = INDIO_DIRECT_MODE;
if (ddata->chip_info->four_channel) {
- indio_dev->channels = ltc2493_channel;
+ if (ddata->chip_info->has_speed_mode)
+ indio_dev->channels = ltc2493_channel_samp_freq;
+ else
+ indio_dev->channels = ltc2493_channel;
indio_dev->num_channels = ARRAY_SIZE(ltc2493_channel);
} else {
if (ddata->chip_info->has_speed_mode)
diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c
index 12c8a2fecc07..a655b04e2454 100644
--- a/drivers/iio/adc/ltc2497.c
+++ b/drivers/iio/adc/ltc2497.c
@@ -175,6 +175,7 @@ static const struct ltc2497_chip_info ltc2497_info[] = {
.resolution = 24,
.name = "ltc2493",
.has_temp = true,
+ .has_speed_mode = true,
.four_channel = true,
},
[TYPE_LTC2497] = {
--
2.43.0