[PATCH v4 0/9] iio: temperature: ltc2983: Add support for ADT7604

From: Liviu Stan

Date: Mon May 25 2026 - 12:41:28 EST


This series adds support for the ADT7604 multi-sensor temperature
measurement and leak detection system to the existing ltc2983 driver.

The ADT7604 shares the same die as the LTC2984, reusing its register
map and SPI interface. It repurposes the custom RTD sensor type (18)
as a copper trace resistance sensor and the custom thermistor type (27)
as a leak detector, removing thermocouple, diode and direct ADC support.

Patches 1-6 fix pre-existing bugs in the ltc2983 driver: an n_wires
default that silently bypassed the current-rotate validation, a
reinit_completion() call after the hardware conversion was started,
macro parenthesization and renaming, inconsistent use of the local
device pointer, inconsistent channel wording in log messages, and
missing fwnode_property_present() guards for optional properties.

Patch 7 adds IIO_COVERAGE, a new channel type for sensors reporting
fractional surface coverage as a percentage.

Patch 8 updates the device tree bindings: adds adi,adt7604 compatible,
copper-trace@ and leak-detector@ sensor node types with their respective
properties, and an ADT7604 example.

Patch 9 updates the driver: introduces two new software sensor type
values (LTC2983_SENSOR_COPPER_TRACE = 32, LTC2983_SENSOR_LEAK_DETECTOR
= 33) with dedicated structs and parser functions rather than extending
the existing RTD and thermistor paths. The hardware configuration bits
are fully hardcoded for both sensor types, and several RTD/thermistor
DT properties have no meaning for them. A u64 supported_sensors bitmask
in ltc2983_chip_info gates sensor type validation per chip, replacing
the has_temp bool pattern. BIT_ULL() is used for the new type values
at bits 32 and 33 to avoid shifting beyond 32 bits on 32-bit builds.

Tested on EVAL-ADT7604-AZ connected to Raspberry Pi 5 via SPI.

Changes in v4:

The n_wires fix was moved to position 1 and a new reinit_completion()
fix was inserted at position 2.

Patch 1 - Fix n_wires default bypassing rotation check:
- Moved to the front of the series

Patch 2 - Fix reinit_completion() called after conversion start:
- New patch

Patch 3 - macro parenthesization and rename:
- Added Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>

Patch 4 - use local device pointer consistently:
- Collapsed some wrapped lines that now fit within 80 characters
- Decided to leave lines that would slightly pass 80 characters
wrapped since they looked more readable
- Updated commit message to reflect the line consolidation
- Added Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>

Patch 5 - fix inconsistent channel wording in messages:
- Added Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>

Patch 7 - IIO_COVERAGE channel type:
- Renamed the sysfs attribute from in_coverageX_raw to in_coverageY_raw
and in_coverageX_scale to in_coverageY_scale to follow ABI convention
- Updated commit message to reflect the rename

Patch 8 - DT bindings:
- Added restrictions for adi,sensor-type = <18> in ^rtd@ nodes and
adi,sensor-type = <27> in ^thermistor@ nodes for adi,adt7604

Patch 9 - driver:
- Removed trailing comma from LTC2983_SENSOR_NUM enum sentinel
- Sorted id_table, of_match, and chip_info_data structs alphabetically

Liviu Stan (9):
iio: temperature: ltc2983: Fix n_wires default bypassing rotation
check
iio: temperature: ltc2983: Fix reinit_completion() called after
conversion start
iio: temperature: ltc2983: Fix macro parenthesization and rename
iio: temperature: ltc2983: Use local device pointer consistently
iio: temperature: ltc2983: Fix inconsistent channel wording in
messages
iio: temperature: ltc2983: Use fwnode_property_present() for optional
properties
iio: core: Add IIO_COVERAGE channel type
dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
iio: temperature: ltc2983: Add support for ADT7604

Documentation/ABI/testing/sysfs-bus-iio | 17 +
.../bindings/iio/temperature/adi,ltc2983.yaml | 217 +++++-
drivers/iio/industrialio-core.c | 1 +
drivers/iio/temperature/ltc2983.c | 621 +++++++++++++++---
include/uapi/linux/iio/types.h | 1 +
tools/iio/iio_event_monitor.c | 2 +
6 files changed, 752 insertions(+), 107 deletions(-)

--
2.43.0