public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/4] iio: adc: ad7380: add alert support
@ 2024-12-24  9:34 Julien Stephan
  2024-12-24  9:34 ` [PATCH RFC v2 1/4] iio: adc: ad7380: do not use iio_device_claim_direct_scoped anymore Julien Stephan
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Julien Stephan @ 2024-12-24  9:34 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sá,
	David Lechner, Jonathan Cameron, Jonathan Corbet
  Cc: linux-iio, linux-kernel, linux-doc, Julien Stephan

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-01-12 11:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24  9:34 [PATCH RFC v2 0/4] iio: adc: ad7380: add alert support Julien Stephan
2024-12-24  9:34 ` [PATCH RFC v2 1/4] iio: adc: ad7380: do not use iio_device_claim_direct_scoped anymore Julien Stephan
2024-12-27  8:43   ` Uwe Kleine-König
2024-12-28 13:51     ` Jonathan Cameron
2024-12-28 13:49   ` Jonathan Cameron
2024-12-24  9:34 ` [PATCH RFC v2 2/4] iio: adc: ad7380: enable regmap cache Julien Stephan
2024-12-27  8:48   ` Uwe Kleine-König
2024-12-28 14:07     ` Jonathan Cameron
2024-12-28 14:02   ` Jonathan Cameron
2024-12-24  9:34 ` [PATCH RFC v2 3/4] iio: adc: ad7380: add alert support Julien Stephan
2024-12-27  9:39   ` Uwe Kleine-König
2024-12-28 14:24   ` Jonathan Cameron
2025-01-06 15:29     ` David Lechner
2025-01-07  8:51       ` Julien Stephan
2025-01-11 12:51         ` Jonathan Cameron
2025-01-12 11:40           ` Jonathan Cameron
2024-12-24  9:34 ` [PATCH RFC v2 4/4] docs: iio: " Julien Stephan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox