Devicetree
 help / color / mirror / Atom feed
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>,
	"Francesco Lavra" <flavra@baylibre.com>,
	"Liviu Stan" <liviu.stan@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux@analog.com, devicetree@vger.kernel.org
Subject: [PATCH v4 0/9] iio: temperature: ltc2983: Add support for ADT7604
Date: Mon, 25 May 2026 19:39:27 +0300	[thread overview]
Message-ID: <20260525164013.118614-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-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@gmail.com>

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@gmail.com>

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

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


             reply	other threads:[~2026-05-25 16:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 16:39 Liviu Stan [this message]
2026-05-25 16:39 ` [PATCH v4 1/9] iio: temperature: ltc2983: Fix n_wires default bypassing rotation check Liviu Stan
2026-05-27 16:11   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 2/9] iio: temperature: ltc2983: Fix reinit_completion() called after conversion start Liviu Stan
2026-05-27 16:13   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 3/9] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-27 16:13   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 4/9] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-27 16:18   ` Jonathan Cameron
2026-06-02 23:25     ` Andy Shevchenko
2026-06-03 14:08       ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 5/9] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-27 16:19   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 6/9] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-05-27 16:19   ` Jonathan Cameron
2026-06-02 23:26     ` Andy Shevchenko
2026-06-03 14:01       ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 7/9] iio: core: Add IIO_COVERAGE channel type Liviu Stan
2026-05-27 16:51   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 8/9] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-25 18:28   ` sashiko-bot
2026-05-26 16:55   ` Conor Dooley
2026-05-27 15:59     ` Liviu Stan
2026-05-27 16:51     ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 9/9] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-25 19:06   ` sashiko-bot
2026-05-26  8:47   ` Liviu Stan
2026-05-27 16:49     ` Jonathan Cameron
2026-06-02  6:38       ` 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=20260525164013.118614-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