Re: [PATCH v5 2/2] iio: adc: ad7173: add openwire detection support for single conversions

From: Jonathan Cameron
Date: Sat Feb 01 2025 - 07:38:30 EST


On Mon, 27 Jan 2025 14:59:33 +0100
Guillaume Ranquet <granquet@xxxxxxxxxxxx> wrote:

> Some chips of the ad7173 family supports open wire detection.
>
> Generate a level fault event whenever an external source is disconnected
> from the system input on single conversions.
>
> Reviewed-by: Nuno Sa <nuno.sa@xxxxxxxxxx>
> Signed-off-by: Guillaume Ranquet <granquet@xxxxxxxxxxxx>
> ---

>
> +/*
> + * Associative array of channel pairs for open wire detection
> + * The array is indexed by ain and gives the associated channel pair
> + * to perform the open wire detection with
> + * the channel pair [0] is for non differential and pair [1]
> + * is for differential inputs
> + */
> +static int openwire_ain_to_channel_pair[][2][2] = {
> +/* AIN Single Differential */
> + [0] = { {0, 15}, {1, 2} },
> + [1] = { {1, 2}, {2, 1} },
> + [2] = { {3, 4}, {5, 6} },
> + [3] = { {5, 6}, {6, 5} },
> + [4] = { {7, 8}, {9, 10} },
> + [5] = { {9, 10}, {10, 9} },
> + [6] = { {11, 12}, {13, 14} },
> + [7] = { {13, 14}, {14, 13} },
Given I've been poking others this morning to add spaces after { and before }
(arbitrary choice but for IIO at least I'd prefer consistency!)
I've added those whilst applying.


Series applied to the togreg branch of iio.git.
I'll be rebasing that on rc1 once available, so for now just pushed out as
testing.

thanks,

Jonathan