Re: [PATCH v3 5/5] docs: iio: ad7380: add alert support

From: David Lechner
Date: Tue Jan 07 2025 - 12:27:26 EST


On 1/7/25 2:48 AM, Julien Stephan wrote:
> Add a section for alert support, explaining how user can use iio events
> attributes to enable alert and set thresholds.
>
> Signed-off-by: Julien Stephan <jstephan@xxxxxxxxxxxx>
> ---
> Documentation/iio/ad7380.rst | 32 +++++++++++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/iio/ad7380.rst b/Documentation/iio/ad7380.rst
> index c46127700e14ca9ec3cac0bd5776b6702f2659e2..9b4407eeaf1d4309c06c64071ed08b4ac80944d2 100644
> --- a/Documentation/iio/ad7380.rst
> +++ b/Documentation/iio/ad7380.rst
> @@ -92,6 +92,37 @@ must restart iiod using the following command:
>
> root:~# systemctl restart iiod
>
> +Alert
> +-----
> +
> +When configured in 1 SDO line mode (see `SPI wiring modes`_), the SDOB or the
> +SDOD line (respectively for the 2 or 4 channels variants) can act as an alert
> +pin.

I think 4-channel variant could also be used in 2-wire mode while also using
ALERT. Of course, that isn't supported in the driver yet though.

> +
> +At the end of a conversion the low-active alert pin gets asserted if the

nit: active-low

> +conversion result exceeds the alert high limit or falls below the alert low
> +limit. It is cleared, on a falling edge of CS. The alert pin is common to all
> +channels.
> +
> +User can enable alert using the regular iio events attribute:
> +
> +.. code-block:: bash
> +
> + events/thresh_either_en
> +
> +The high and low thresholds are common to all channels and can also be set using
> +regular iio events attributes:
> +
> +.. code-block:: bash
> +
> + events/in_thresh_falling_value
> + events/in_thresh_rising_value
> +
> +If debugfs is enabled anc configured, user can read the ALERT register to

s/anc/and/

or

s/enabled and configured/available/


> +determine the faulty channel and direction.
> +
> +In most use cases, user will hardwire the alert pin to trigger a shutdown.
> +
> Channel selection and sequencer (single-end chips only)
> -------------------------------------------------------
>
> @@ -144,7 +175,6 @@ Unimplemented features
> - Rolling average oversampling
> - Power down mode
> - CRC indication
> -- Alert
>
>
> Device buffers
>

With the typo fixed:

Reviewed-by: David Lechner <dlechner@xxxxxxxxxxxx>