Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add support for LTC2305
@ 2026-03-24  7:13 Carlos Jones Jr
  2026-03-24  7:13 ` [PATCH v2 1/4] iio: adc: ltc2309: Introduce chip_info structure Carlos Jones Jr
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Carlos Jones Jr @ 2026-03-24  7:13 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, David Lechner,
	Michael Hennerich, Liam Beguin, Nuno Sá, Andy Shevchenko,
	Tobias Sperling, Jorge Marques
  Cc: linux-iio, devicetree, linux-kernel

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@analog.com/

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-26  8:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24  7:13 [PATCH v2 0/4] Add support for LTC2305 Carlos Jones Jr
2026-03-24  7:13 ` [PATCH v2 1/4] iio: adc: ltc2309: Introduce chip_info structure Carlos Jones Jr
2026-03-24 12:24   ` Andy Shevchenko
2026-03-25  0:01     ` Jones, Carlos jr
2026-03-24  7:13 ` [PATCH v2 2/4] iio: adc: ltc2309: Use i2c_get_match_data() helper Carlos Jones Jr
2026-03-24 12:35   ` Andy Shevchenko
2026-03-24  7:13 ` [PATCH v2 3/4] dt-bindings: iio: adc: ltc2497: Add LTC2305 compatible Carlos Jones Jr
2026-03-24 12:36   ` Krzysztof Kozlowski
2026-03-24  7:13 ` [PATCH v2 4/4] iio: adc: ltc2309: Add LTC2305 support Carlos Jones Jr
2026-03-24 12:39   ` Andy Shevchenko
2026-03-25 20:19 ` [PATCH v2 0/4] Add support for LTC2305 Jonathan Cameron
2026-03-26  2:21   ` Jones, Carlos jr
2026-03-26  8:17     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox