lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230408113133.GB141200@dalakolonin.se>
Date:   Sat, 8 Apr 2023 13:31:33 +0200
From:   Patrik Dahlström <risca@...akolonin.se>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        letux-kernel@...nphoenux.org, kernel@...a-handheld.com,
        pgoudagunta@...dia.com, hns@...delico.com, lars@...afoo.de,
        linux-omap@...r.kernel.org
Subject: Re: [PATCH v3 6/7] iio: adc: palmas: add support for iio threshold
 events

On Fri, Apr 07, 2023 at 06:19:47PM +0100, Jonathan Cameron wrote:
> On Wed,  5 Apr 2023 23:22:32 +0200
> Patrik Dahlström <risca@...akolonin.se> wrote:
> 
> > The palmas gpadc block has support for monitoring up to 2 ADC channels
> > and issue an interrupt if they reach past a set threshold. This change
> > hooks into the IIO events system and exposes to userspace the ability to
> > configure these threshold values for each channel, but only allow up to
> > 2 such thresholds to be enabled at any given time. Trying to enable a
> > third channel will result in an error.
> > 
> > Userspace is expected to input calibrated, as opposed to raw, values as
> > threshold. However, it is not enough to do the opposite of what is done
> > when converting the other way around. To account for tolerances in the
> > ADC, the calculated raw threshold should be adjusted based on the ADC
> > specifications for the device. These specifications include the integral
> > nonlinearity (INL), offset, and gain error. To adjust the high
> > threshold, use the following equation:
> > 
> >   (calibrated value + INL) * Gain error + offset = maximum value  [1]
> > 
> > Likewise, use the following equation for the low threshold:
> > 
> >   (calibrated value - INL) * Gain error - offset = minimum value
> > 
> > The gain error is a combination of gain error, as listed in the
> > datasheet, and gain error drift due to temperature and supply. The exact
> > values for these specifications vary between palmas devices. This patch
> > sets the values found in TWL6035, TWL6037 datasheet.
> > 
> > [1] TI Application Report, SLIA087A, Guide to Using the GPADC in
> >     TPS65903x, TPS65917-Q1, TPS65919-Q1, and TPS65916 Devices.
> > 
> > Signed-off-by: Patrik Dahlström <risca@...akolonin.se>
> Hi Patrik,
> 
> A few really trivial formatting things inline. If we don't end up
> with a v4 for other reasons I can tidy this stuff up whilst applying.

I'll send in a v4 later today :)

> 
> Jonathan
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ