[PATCH v2 0/4] Add support for LTC2305

From: Carlos Jones Jr

Date: Tue Mar 24 2026 - 03:15:26 EST


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 introducing a chip_info
structure to handle the different channel configurations between the two
variants. The LTC2305 exposes 2 single-ended channels and 2 differential
combinations.

Also updates the device tree bindings to include the lltc,ltc2305
compatible string and documents it in the Kconfig.
---
Changes in v2:
- Changed usleep_range() to fsleep()
- Added missing #include <linux/array_size.h> header
- Removed explicit .read_delay_us = 0 initialization (implicit zero)
- Added __counted_by_ptr() annotation to channels pointer
- Modified ltc2309 struct to store only read_delay_us value instead
of full chip_info pointer, reducing memory overhead
- Alphabetically ordered device entries in ID tables (ltc2305
before ltc2309)
- Reformatted Kconfig help text with explicit bulleted list of
supported devices instead of vague "and similar" language
- Added device names to chip_info structure for proper sysfs
identification
- Split changes into proper preparatory patches before adding
new device support
- Link to v1: https://lore.kernel.org/all/20260320140819.191700-1-carlosjr.jones@xxxxxxxxxx/

Note:
The ltc2309_chip_info structure has a 4-byte hole due to alignment
requirements for the __counted_by_ptr() annotation. The count field
must precede the pointer field for the bounds checking to work correctly.
The total structure size remains 32 bytes either way due to required
padding, so the memory overhead is minimal (8 bytes total for both chip
variants).
---
Carlos Jones Jr (4):
iio: adc: ltc2309: Introduce chip_info structure
iio: adc: ltc2309: Use i2c_get_match_data() helper
dt-bindings: iio: adc: ltc2497: Add LTC2305 compatible
iio: adc: ltc2309: Add LTC2305 support

.../bindings/iio/adc/lltc,ltc2497.yaml | 9 ++-
drivers/iio/adc/Kconfig | 8 ++-
drivers/iio/adc/ltc2309.c | 59 ++++++++++++++++---
3 files changed, 65 insertions(+), 11 deletions(-)

--
2.43.0