[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACbQKWe5xGT80_ZcQmTYrGThtFyw6xKD_OmGLi8XGi0pvR1RBA@mail.gmail.com>
Date: Sat, 12 Nov 2022 22:19:07 +0100
From: Mitja Špes <mitja@...av.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Angelo Compagnucci <angelo.compagnucci@...il.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] iio: adc: mcp3422: add hardware gain attribute
Hi Jonathan,
On Sat, Nov 12, 2022 at 6:20 PM Jonathan Cameron <jic23@...nel.org> wrote:
> How are the separate? We normally only use hardwaregain if
> changing it has no input on the scale that we need to apply in userspace
> to raw channels. This normally happens for two reasons
> 1) There is a micro controller on the sensor that is doing a bunch of
> maths so whilst changing the PGA value changes the range measurable it
> doesn't affect the representation when we read from the device.
> 2) The hardware gain is controlling say the sensitivity of a light sensor
> in a time of flight device - it affects if we can get a measurement, but
> not the measurement itself.
>
> Any of that true here?
No. I see I misunderstood the hardwaregain attribute. For me this is a user
friendly way of setting the gain and subsequently scale.
What I don't understand is why set scale at all? It's a result of sampling
rate and gain settings. Using it as a setting, for which input value range also
changes depending on another attribute is quite cumbersome.
To use a sensor the program has to do this:
1. set the sampling rate
2. read available scales for this sampling rate
3. set the scale according to desired gain
or know the scales for each sampling rate in advance...which makes available
scales attribute quite useless.
Kind regards,
Mitja
Powered by blists - more mailing lists