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@xxxxxxxxxxxx Signed-off-by: Julien Stephan <jstephan@xxxxxxxxxxxx> --- 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@xxxxxxxxxxxx --- 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@xxxxxxxxxxxx>