Re: [PATCH 2/6] iio: adc: ltc2497: add LTC2493 support

From: Jonathan Cameron

Date: Sat Oct 17 2026 - 23:14:24 EST


On Fri, 09 Oct 2026 11:43:35 +0300
Andrei Stancovici via B4 Relay <devnull+andrei.stancovici.analog.com@xxxxxxxxxx> wrote:

> From: Andrei Stancovici <andrei.stancovici@xxxxxxxxxx>
>
> The LTC2493 is the 4-channel member of the LTC2499 family: 4 single-ended
> inputs or 2 differential pairs, with the same command format and 24-bit
> result. Add it with its own channel table.
>
> Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/2493fe.pdf
> Signed-off-by: Andrei Stancovici <andrei.stancovici@xxxxxxxxxx>
Hi Andrei,

My only comment on here is 'where there are 16 and 4 channel similar chips,
an 8 channel and maybe even a 2 channel are likely to show up!'.

So upshot. Use an integer for number of channels instead of
that bool.
> diff --git a/drivers/iio/adc/ltc2497.h b/drivers/iio/adc/ltc2497.h
> index cee9a2f50b82..219f7d49854b 100644
> --- a/drivers/iio/adc/ltc2497.h
> +++ b/drivers/iio/adc/ltc2497.h
> @@ -31,6 +31,7 @@ struct ltc2497_chip_info {
> u32 resolution;
> bool has_temp;
> bool has_speed_mode; /* SPD bit in the 2nd config byte (LTC2499/LTC2493) */
> + bool four_channel; /* 4 inputs (LTC2493) instead of 16 */

This feels like it will bite us in future. Can we instead just
encode the number of channels? That will mean setting the value
to 16 for existing entrees but that doesn't seem too bad to me.

> };
>
> struct ltc2497core_driverdata {
>