Re: [PATCH 3/3] iio: adc: ltc2309: add support for LTC2305

From: Andy Shevchenko

Date: Fri Mar 20 2026 - 10:57:58 EST


On Fri, Mar 20, 2026 at 10:08:19PM +0800, Carlos Jones Jr wrote:
> The LTC2305 is a 2-channel, 12-bit, fast ADC with an I2C interface,
> compatible with the LTC2309 (which has 8 channels).
>
> This patch adds support for the LTC2305 by using the chip_info
> structure to handle the different channel configurations between the
> two variants. The LTC2305 exposes 2 single-ended channels and 2
> differential combinations.
>
> The LTC2305 requires a 1.6μs delay between I2C write and read
> operations, which is implemented using chip-specific timing to avoid
> affecting existing LTC2309 functionality.

...

> config LTC2309
> - tristate "Linear Technology LTC2309 ADC driver"
> + tristate "Linear Technology LTC2309 and similar ADC driver"
> depends on I2C
> help
> - Say yes here to build support for Linear Technology LTC2309, a low
> - noise, low power, 8-channel, 12-bit SAR ADC
> + Say yes here to build support for Linear Technology LTC2309 and
> + similar low noise, low power SAR ADCs.

No, in Kconfig help text (and possibly title above) we have to be crystal
clear for user what IPs (chips, SoCs, et cetera) are being supported by
the driver. There is no go for 'and similar'.

...

> - ltc2309->chip_info = &ltc2309_chip_info;
> + ltc2309->chip_info = i2c_get_match_data(client);

Strictly speaking this change with the associated ID table changes should go
in a separate patch.

...

> static const struct of_device_id ltc2309_of_match[] = {
> - { .compatible = "lltc,ltc2309" },
> + { .compatible = "lltc,ltc2309", .data = &ltc2309_chip_info },


> + { .compatible = "lltc,ltc2305", .data = &ltc2305_chip_info },

Keep it ordered by the value of compatible string.

> { }
> };

...

> static const struct i2c_device_id ltc2309_id[] = {
> - { "ltc2309" },
> + { "ltc2309", (kernel_ulong_t)&ltc2309_chip_info },
> + { "ltc2305", (kernel_ulong_t)&ltc2305_chip_info },
> { }

In the similar way as above.

> };

--
With Best Regards,
Andy Shevchenko