[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d735a95-e5bd-4891-bb44-335958e1f045@gmail.com>
Date: Mon, 15 Jan 2024 11:13:45 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Lars-Peter Clausen <lars@...afoo.de>, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org
Subject: Re: [PATCH 2/3] iio: test: test gain-time-scale helpers
On 1/13/24 18:12, Jonathan Cameron wrote:
> On Wed, 10 Jan 2024 12:12:55 +0200
> Matti Vaittinen <mazziesaccount@...il.com> wrote:
>
>> Some light sensors can adjust both the HW-gain and integration time.
>> There are cases where adjusting the integration time has similar impact
>> to the scale of the reported values as gain setting has.
>>
>> IIO users do typically expect to handle scale by a single writable 'scale'
>> entry. Driver should then adjust the gain/time accordingly.
>>
>> It however is difficult for a driver to know whether it should change
>> gain or integration time to meet the requested scale. Usually it is
>> preferred to have longer integration time which usually improves
>> accuracy, but there may be use-cases where long measurement times can be
>> an issue. Thus it can be preferable to allow also changing the
>> integration time - but mitigate the scale impact by also changing the gain
>> underneath. Eg, if integration time change doubles the measured values,
>> the driver can reduce the HW-gain to half.
>>
>> The theory of the computations of gain-time-scale is simple. However,
>> some people (undersigned) got that implemented wrong for more than once.
>> Hence some gain-time-scale helpers were introduced.
>>
>> Add some simple tests to verify the most hairy functions.
>>
>> Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>
>>
> Hi Matti,
>
> All seems reasonable to me. Some trivial formatting things inline
> + I'm not planning to check the maths as you are the expert in all of
> this so I'll just trust you!
Well, all checking is always welcome. Still, I kind of understand that
you won't verify everything you see... Oh, and thanks for the trust. :)
> Also if this fails you get to pick up the pieces :)
This sure helps to trust ;)
As for things you commented - Thanks! I'll fix them and respin.
Yours,
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Powered by blists - more mailing lists