Re: [PATCH v3 11/17] iio: core: Introduce _zeropoint for differential channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 Jul 2022 19:02:35 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> On Tue, 28 Jun 2022 14:17:33 +0200
> Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:
> 
> > On Sun, Jun 26, 2022 at 2:20 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:  
> > >
> > > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> > >
> > > 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.
6.0 I guess :)  Anyhow I've applied this with Andy's tag on the assumption that the below
English quirk is fine by Andy.

Jonathan

> 
> >   
> > > +Contact:       linux-iio@xxxxxxxxxxxxxxx
> > > +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.    
> >   
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux