Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	Peter Rosin <peda@axentia.se>,
	Michael Hennerich <michael.hennerich@analog.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 11/17] iio: core: Introduce _zeropoint for differential channels
Date: Mon, 18 Jul 2022 19:02:35 +0100	[thread overview]
Message-ID: <20220718190235.6578113b@jic23-huawei> (raw)
In-Reply-To: <CAHp75VcSaW08brrFRhKQYVCLbNdQz=SG80OmYkPrv028wSuk6g@mail.gmail.com>

On Tue, 28 Jun 2022 14:17:33 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sun, Jun 26, 2022 at 2:20 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Address an ABI gap for device where the offset of both lines in a
> > differential pair may be controlled so as to allow a wider range of
> > inputs, but without having any direct effect of the differential
> > measurement.
> >
> > _offset cannot be used as to remain in line with existing usage,
> > userspace would be expected to apply it as (_raw + _offset) * _scale
> > whereas _zeropoint is not. i.e. If we were computing the differential
> > in software it would be.
> > ((postive_raw + _zeropoint) - (negative_raw + zeropoint) + _offset) * _scale
> > = ((postive_raw - negative_raw) + _offset) * _scale
> > = (differential_raw + _offset) * _scale
> >
> > Similarly calibbias is expected to tweak the measurement seen, not
> > the adjust the two lines of the differential pair.
> >
> > Needed for in_capacitanceX-capacitanceY_zeropoint for the
> > AD7746 CDC driver.  
> 
> ...
> 
> > +What:          /sys/.../iio:deviceX/in_capacitanceY-capacitanceZ_zeropoint
> > +KernelVersion: 5.19  
> 
> 5.20?

:) Probably 5.21 as I'm not going to rush this in now, but good point none the less.

> 
> > +Contact:       linux-iio@vger.kernel.org
> > +Description:
> > +               For differential channels, this an offset that is applied
> > +               equally to both inputs. As the reading is of the difference
> > +               between the two inputs, this should not be applied to the _raw
> > +               reading by userspace (unlike _offset) and unlike calibbias
> > +               it does not affect the differential value measured because
> > +               the effect of _zeropoint cancels out across the two inputs
> > +               that make up the differential pair. It's purpose is to bring  
> 
> makes

No.  make is correct.
That's indeed an odd corner of English and honestly I'm not sure I could successfully
argue why it should be make :)

> 
> > +               the individual signals, before the differential is measured,
> > +               within the measurement range of the device. The naming is
> > +               chosen because if the separate inputs that make the
> > +               differential pair are drawn on a graph in their
> > +               _raw  units, this is the value that the zero point on the
> > +               measurement axis represents. It is expressed with the
> > +               same scaling as _raw.  
> 


  reply	other threads:[~2022-07-18 17:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26 12:29 [PATCH v3 00/17] staging/iio: Clean up AD7746 CDC driver and move from staging Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 01/17] iio: core: Increase precision of IIO_VAL_FRACTIONAL_LOG2 when possible Jonathan Cameron
2022-08-07 13:28   ` Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 02/17] iio: ABI: Fix wrong format of differential capacitance channel ABI Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 03/17] staging: iio: cdc: ad7746: Use explicit be24 handling Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 04/17] staging: iio: cdc: ad7746: Push handling of supply voltage scale to userspace Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 05/17] staging: iio: cdc: ad7746: Use local buffer for multi byte reads Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 06/17] staging: iio: cdc: ad7746: Factor out ad7746_read_channel() Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 07/17] staging: iio: cdc: ad7764: Push locking down into case statements in read/write_raw Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 08/17] staging: iio: cdc: ad7746: Break up use of chan->address and use FIELD_PREP etc Jonathan Cameron
2022-06-28 12:15   ` Andy Shevchenko
2022-08-07 13:40     ` Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 09/17] staging: iio: cdc: ad7746: Drop unused i2c_set_clientdata() Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 10/17] staging: iio: cdc: ad7746: Use _raw and _scale for temperature channels Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 11/17] iio: core: Introduce _zeropoint for differential channels Jonathan Cameron
2022-06-28 12:17   ` Andy Shevchenko
2022-07-18 18:02     ` Jonathan Cameron [this message]
2022-08-07 13:46       ` Jonathan Cameron
2022-08-07 13:50         ` Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 12/17] staging: iio: cdc: ad7746: Switch from _offset to " Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 13/17] staging: iio: cdc: ad7746: Use read_avail() rather than opencoding Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 14/17] staging: iio: ad7746: White space cleanup Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 15/17] iio: cdc: ad7746: Add device specific ABI documentation Jonathan Cameron
2022-06-28 12:19   ` Andy Shevchenko
2022-06-26 12:29 ` [PATCH v3 16/17] iio: cdc: ad7746: Move driver out of staging Jonathan Cameron
2022-06-26 12:29 ` [PATCH v3 17/17] RFC: iio: cdc: ad7746: Add roadtest Jonathan Cameron
2022-06-28 12:21 ` [PATCH v3 00/17] staging/iio: Clean up AD7746 CDC driver and move from staging Andy Shevchenko
2022-08-07 14:06   ` Jonathan Cameron

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=20220718190235.6578113b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=peda@axentia.se \
    --cc=vincent.whitchurch@axis.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