Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<nuno.sa@analog.com>, <Michael.Hennerich@analog.com>,
	<dlechner@baylibre.com>, <andy@kernel.org>,
	<marcelo.schmitt1@gmail.com>
Subject: Re: [PATCH v10 2/2] iio: ABI: Encourage differential voltage ABI usage
Date: Sat, 22 Aug 2026 03:22:24 +0100	[thread overview]
Message-ID: <20260822032224.2dbb88b2@jic23-huawei> (raw)
In-Reply-To: <5760e0d12184eb0d7cf6fec34ad4b6da2d8669e0.1786662010.git.marcelo.schmitt@analog.com>

On Thu, 13 Aug 2026 20:05:33 -0300
Marcelo Schmitt <marcelo.schmitt@analog.com> wrote:

> So far, parts that could only do differential voltage measurements were
> only required to have a consistent labeling of their channels by complying
> either to voltageY or to voltageY-voltageZ ABI. Over time, code maintainers
> came to the conclusion that the voltageY-voltageZ ABI is better suited for
> differential-only chips as it provides a simple indication to users that
> the channels measure the difference of two inputs.
> 
> Adjust the ABI documentation to recommend using the voltageY-voltageZ ABI
> for chips that do only differential voltage measurements.
> 
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Hi Marcelo,

I applied earlier version I think. Please send a diff on top.

Too much floating around at the moment so I'm sorry to say
I'm loosing track even with tools to help me!

Jonathan

> ---
> Change log v9 -> v10:
> - Mention the possibility of having same index for diff channels (e.g. voltageX-voltageX)
>   in ABI doc.
> 
> After looking at a few other chips I'm not sure either about having
> voltageX-voltageX in the docs. I worry voltageX-voltageX might not provide a
> clear unambiguous indication of channel properties. Nevertheless, mentioned that
> possibility as a special case.
> 
> For chips that have configurable inputs such that both differential and
> non-differential readings are separately available (current ABI usage),
> voltageX-voltageX can mean both ADC ends connected to the same physical input
> pins (e.g. AIN3 and AIN3, CH3 and CH3, V3 and V3 ...).  That seems to not make
> much sense for most parts. Though, there are corner cases where the same input
> number is used to configure both ADC ends (e.g. to access a temperature sensor
> through an embedded multiplexer).
> 
> For chips that can only do differential measurements, voltageX-voltageX would
> mean the positive and negative inputs of a differential channel to have the same
> index (e.g. IN3+ and IN3-, AI3P and AI3N, AIN3+ and AIN3-, etc). The ABI is the
> same, but the meaning would be different. Even though we have the left-most
> index for the positive end and right-most for the negative end, that's not
> enough to fully tell how a channel works.
> 
> 
>  Documentation/ABI/testing/sysfs-bus-iio | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 5cc2e82c4997..bb17105650ab 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -162,10 +162,12 @@ Contact:	linux-iio@vger.kernel.org
>  Description:
>  		Raw (unscaled) differential voltage measurement equivalent to
>  		channel Y - channel Z where these channel numbers apply to the
> -		physically equivalent inputs when non differential readings are
> -		separately available. In differential only parts, then all that
> -		is required is a consistent labeling.  Units after application
> -		of scale and offset are millivolts.
> +		physically equivalent inputs when non-differential readings are
> +		separately available. Even though differential-only parts had
> +		been merely required to have consistent channel labeling, this
> +		ABI is preferred over the non-differential one for those chips.
> +		Special configurations may have the same index for both Y and Z.
> +		Units after application of scale and offset are millivolts.
>  
>  What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltageY_rms_raw
>  KernelVersion:	6.18


      reply	other threads:[~2026-08-22  2:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1786662010.git.marcelo.schmitt@analog.com>
2026-08-13 23:05 ` [PATCH v10 2/2] iio: ABI: Encourage differential voltage ABI usage Marcelo Schmitt
2026-08-22  2:22   ` Jonathan Cameron [this message]

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=20260822032224.2dbb88b2@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=marcelo.schmitt@analog.com \
    --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