diff options
| author | Julien Stephan <jstephan@baylibre.com> | 2025-01-08 13:49:36 +0100 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-02-03 19:15:37 +0000 |
| commit | 27d1a4dbe1e150692c39a9056af018cb792234fd (patch) | |
| tree | 3a687a697b1cd53d30bc20ae150866e901e38bb2 /include/linux | |
| parent | adc59fe0c2222ee578fe40f4ae7ef6bb380dcd73 (diff) | |
iio: adc: ad7380: add alert support
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/
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250108-ad7380-add-alert-support-v4-4-1751802471ba@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
