[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241224-ad7380-add-alert-support-v2-0-7c89b2bf7cb3@baylibre.com>
Date: Tue, 24 Dec 2024 10:34:29 +0100
From: Julien Stephan <jstephan@...libre.com>
To: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Nuno Sá <nuno.sa@...log.com>,
David Lechner <dlechner@...libre.com>, Jonathan Cameron <jic23@...nel.org>,
Jonathan Corbet <corbet@....net>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, Julien Stephan <jstephan@...libre.com>
Subject: [PATCH RFC v2 0/4] iio: adc: ad7380: add alert support
Hello,
The ad738x family includes a built-in alert mechanism for early
detection of out-of-bounds conversion results. This series introduces
this functionality to the ad7380 family.
As a reminder, an RFC was sent [1] with several open questions.
Here is a summary of the changes made:
- I now have a better understanding of the alert high/low registers, and
it is much simpler than I initially thought: users can use the same
scale as the raw value; we just need to extract the 12 MSBs.
- IRQs are now disabled by default and only enabled before read_raw and
buffered_read operations.
- I implemented the reset timeout mechanism, as suggested in the RFC, to
avoid generating too many events during buffered reads (this has no
effect on read_raw).
- Reading registers via debugfs no longer triggers events.
- The reset_timeout attribute is added only if an IRQ is present in the
device tree. However, the high/low thresholds and enable attributes
are always available. This allows configuration of the thresholds and
alert enablement even when no interrupts are defined in the device tree.
For example, a user can enable alerts and hardwire the interrupt line,
without relying on user events.
- I added an alert section to the documentation.
- Two preliminary commits have been added to this series:
- A cleanup patch to remove iio_device_claim_direct_scoped calls.
- A patch to implement regcache.
[1]: https://lore.kernel.org/r/20241029-ad7380-add-aleyyrt-support-v1-1-d0359401b788@baylibre.com
Signed-off-by: Julien Stephan <jstephan@...libre.com>
---
Changes in v2:
- fix read/write high/low thresholds
- add reset_timeout mechanism for buffered reads
- implement regcache
- add cleanup patch to remove iio_device_claim_direct_scoped calls
- add alert section in the Documentation page
- Link to v1: https://lore.kernel.org/r/20241029-ad7380-add-aleyyrt-support-v1-1-d0359401b788@baylibre.com
---
Julien Stephan (4):
iio: adc: ad7380: do not use iio_device_claim_direct_scoped anymore
iio: adc: ad7380: enable regmap cache
iio: adc: ad7380: add alert support
docs: iio: ad7380: add alert support
Documentation/iio/ad7380.rst | 56 ++++-
drivers/iio/adc/ad7380.c | 531 +++++++++++++++++++++++++++++++++++++++----
2 files changed, 537 insertions(+), 50 deletions(-)
---
base-commit: 5ab39233382c621d3271cc274d1534e1b687f4d3
change-id: 20241029-ad7380-add-alert-support-4d0dd6cea8cd
Best regards,
--
Julien Stephan <jstephan@...libre.com>
Powered by blists - more mailing lists