From: Jonathan Cameron <jic23@kernel.org>
To: Julien Stephan <jstephan@baylibre.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Jonathan Corbet" <corbet@lwn.net>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 4/5] iio: adc: ad7380: add alert support
Date: Sun, 12 Jan 2025 11:41:01 +0000 [thread overview]
Message-ID: <20250112114101.63e8e726@jic23-huawei> (raw)
In-Reply-To: <20250107-ad7380-add-alert-support-v3-4-bce10afd656b@baylibre.com>
On Tue, 07 Jan 2025 09:48:28 +0100
Julien Stephan <jstephan@baylibre.com> wrote:
> The alert functionality is an out of range indicator and can be used as
> an early indicator of an out of bounds conversion result.
>
> ALERT_LOW_THRESHOLD and ALERT_HIGH_THRESHOLD registers are common to all
> channels.
>
> When using 1 SDO line (only mode supported by the driver right now), i.e
> data outputs only on SDOA, SDOB (or SDOD for 4 channels variants) is
> used as an alert pin. The alert pin is updated at the end of the
> conversion (set to low if an alert occurs) and is cleared on a falling
> edge of CS.
>
> The ALERT register contains information about the exact alert status:
> channel and direction. ALERT register can be accessed using debugfs if
> enabled.
>
> User can set high/low thresholds and enable alert detection using the
> regular iio events attributes:
>
> events/in_thresh_falling_value events/in_thresh_rising_value
> events/thresh_either_en
>
> In most use cases, user will hardwire the alert pin to trigger a shutdown.
>
> In theory, we could generate userspace IIO events for alerts, but this
> is not implemented yet for several reasons [1]. This can be implemented
> later if a real use case actually requires it.
>
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
>
> [1] https://lore.kernel.org/all/4be16272-5197-4fa1-918c-c4cdfcaee02e@baylibre.com/
Hmm. This does end up odd in that userspace is configuring event
related stuff and not getting an event.
If we can fix that later I'd like to do so, but we can move forwards
with this odd bit of ABI in the meantime. Even then we'd need to support
the case where it's not wired to the host but is really controlling
an external cut off.
I've got nothing else to add to David's review.
Jonathan
next prev parent reply other threads:[~2025-01-12 11:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 8:48 [PATCH v3 0/5] iio: adc: ad7380: add alert support Julien Stephan
2025-01-07 8:48 ` [PATCH v3 1/5] iio: adc: ad7380: do not use iio_device_claim_direct_scoped anymore Julien Stephan
2025-01-07 16:48 ` David Lechner
2025-01-12 11:30 ` Jonathan Cameron
2025-01-07 8:48 ` [PATCH v3 2/5] iio: adc: ad7380: enable regmap cache Julien Stephan
2025-01-07 16:54 ` David Lechner
2025-01-07 8:48 ` [PATCH v3 3/5] iio: adc: ad7380: do not store osr in private data structure Julien Stephan
2025-01-07 17:01 ` David Lechner
2025-01-12 11:34 ` Jonathan Cameron
2025-01-07 8:48 ` [PATCH v3 4/5] iio: adc: ad7380: add alert support Julien Stephan
2025-01-07 17:11 ` David Lechner
2025-01-12 11:41 ` Jonathan Cameron [this message]
2025-01-07 8:48 ` [PATCH v3 5/5] docs: iio: " Julien Stephan
2025-01-07 17:27 ` David Lechner
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=20250112114101.63e8e726@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=corbet@lwn.net \
--cc=dlechner@baylibre.com \
--cc=jstephan@baylibre.com \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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