From: Liviu Stan <liviu.stan@analog.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Liviu Stan" <liviu.stan@analog.com>,
"Francesco Lavra" <flavra@baylibre.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@analog.com, devicetree@vger.kernel.org
Subject: [PATCH v2 0/7] iio: temperature: ltc2983: Add support for ADT7604
Date: Thu, 14 May 2026 17:46:47 +0300 [thread overview]
Message-ID: <20260514144712.64374-1-liviu.stan@analog.com> (raw)
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-4 fix pre-existing bugs in the ltc2983 driver: 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 5 adds IIO_COVERAGE_PERCENT, a new channel type for sensors
reporting fractional surface coverage as a percentage.
Patch 6 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 7 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 v2:
- Patches 1-4: new prerequisite fix patches addressing review comments
on the v1 driver patch.
- Patch 5: new IIO_COVERAGE_PERCENT channel type; replaces the v1
IIO_TEMP workaround for leak detector coverage output.
- Patch 6 (binding):
- Title shortened to "LTC2983 and similar".
- Description device list alphabetised and converted to a bullet list.
- Separate copper-trace@ and leak-detector@ node types retained
(rather than extending rtd@/thermistor@); rationale added to the
commit message.
- "ADT7604 only" wording replaced with "some parts only".
- Patch 7 (driver):
- New software sensor type values LTC2983_SENSOR_COPPER_TRACE = 32
and LTC2983_SENSOR_LEAK_DETECTOR = 33 map to hardware register
values 18 and 27 internally; v1 exposed 18 and 27 directly as
adi,sensor-type values.
- Added n_iio_chan to struct ltc2983_sensor; used in
ltc2983_parse_fw() and ltc2983_setup() to count and assign IIO
channels, removing to_rtd()/to_thermistor() casts from the common
path.
- New sensor types with dedicated structs and functions;
ltc2983_rtd_new() and ltc2983_thermistor_new() are left unchanged.
- has_copper_trace bool replaced by u64 supported_sensors bitmask.
- Both sensor types now share the same 1/1024 resistance scale
(result in ohms); v1 used different scales and incorrectly
described the copper trace result as being in mohms. Since the
sense resistor value is specified in ohms, the output will be in
ohms for both sensor types.
- Leak detector coverage output changed from IIO_TEMP to
IIO_COVERAGE_PERCENT.
- is_sub_ohm replaces sub_ohm in ltc2983_copper_trace struct.
- switch() used for IIO_CHAN_INFO_RAW base register selection.
- Unsupported sensor type validation uses BIT_ULL() checks against
the supported_sensors bitmask.
Liviu Stan (7):
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_PERCENT 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 | 10 +
.../bindings/iio/temperature/adi,ltc2983.yaml | 194 ++++++-
drivers/iio/industrialio-core.c | 1 +
drivers/iio/temperature/ltc2983.c | 532 +++++++++++++++---
include/uapi/linux/iio/types.h | 1 +
tools/iio/iio_event_monitor.c | 1 +
6 files changed, 666 insertions(+), 73 deletions(-)
--
2.43.0
next reply other threads:[~2026-05-14 14:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 14:46 Liviu Stan [this message]
2026-05-14 14:46 ` [PATCH v2 1/7] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-14 14:46 ` [PATCH v2 2/7] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-14 14:46 ` [PATCH v2 3/7] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-14 14:46 ` [PATCH v2 4/7] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-05-14 14:46 ` [PATCH v2 5/7] iio: core: Add IIO_COVERAGE_PERCENT channel type Liviu Stan
2026-05-14 14:46 ` [PATCH v2 6/7] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-14 14:46 ` [PATCH v2 7/7] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260514144712.64374-1-liviu.stan@analog.com \
--to=liviu.stan@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox