From: Jonathan Cameron <jic23@kernel.org>
To: Peter Rosin <peda@axentia.se>
Cc: Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
Linus Walleij <linus.walleij@linaro.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Liam Beguin <liambeguin@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: afe: rescale: Accept only offset channels
Date: Tue, 17 Oct 2023 20:27:29 +0100 [thread overview]
Message-ID: <20231017202729.30f2927f@jic23-huawei> (raw)
In-Reply-To: <2a15c359-2a04-9a45-f30a-c7a0e4b67871@axentia.se>
On Tue, 17 Oct 2023 16:00:22 +0200
Peter Rosin <peda@axentia.se> wrote:
> Hi!
>
> 2023-10-17 at 11:05, Jonathan Cameron wrote:
> > On Mon, 16 Oct 2023 12:05:32 +0200
> > Peter Rosin <peda@axentia.se> wrote:
> >> 2023-10-16 at 10:39, Linus Walleij wrote:
>
>
>
> >>> Just raw (with neither offset or rescale) doesn't make sense, since
> >>
> >> And I don't see why not. That's the crux.
> >>
> >>> the AFE rescaler does just offsetting and rescaling, in that case the
> >>> user should just use the raw channel. Also it would then take
> >>> precedence over a processed channel (which applies rescale and
> >>> offset internally) which doesn't make sense to me.
> >>
> >> Why isn't it perfectly fine for a device to provide only a raw
> >> channel and then expect that to be interpreted as the real unit?
> >> Why would it need a processed channel when no processing is
> >> going on? E.g. a device reporting the temp in the expected unit
> >> in one of its registers. Or whatever with such a friendly
> >> register.
> >
> > In that case it should report a processed value to indicate that.
> > It's admittedly a bit of a corner case given it's not processed by
> > the kernel - there is an argument that this (more or less) only
> > happens when someone has processed a raw ADC count but in theory
> > that's not necessarily true.
> >
> > There are a few examples of drivers passing through the register value
> > as processed in tree - normally when there
> > is a microprocessor doing some fusion of signals or similar.
> >
> > Raw gets reported on it's own in a few other cases, such as when
> > there are no known units - that happens for things like light intensity,
> > proximity (which is often reflected light intensity).
> > For those I'm not sure the rescaler is useful.
>
> Excellent, thanks for the clarification!
>
> Reviewed-by: Peter Rosin <peda@axentia.se>
Thanks,
Applied to the fixes-togreg branch of iio.git. I'll just let this
sit in linux-next for a day or so before a pull request (I have
a few other fixes queued). That will almost certainly get queued for
the merge window given timing.
Thanks,
Jonathan
>
> Cheers,
> Peter
prev parent reply other threads:[~2023-10-17 19:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-02 19:46 [PATCH v2] iio: afe: rescale: Accept only offset channels Linus Walleij
2023-10-14 16:48 ` Jonathan Cameron
2023-10-14 22:38 ` Peter Rosin
2023-10-16 8:39 ` Linus Walleij
2023-10-16 10:05 ` Peter Rosin
2023-10-16 12:54 ` Linus Walleij
2023-10-17 9:05 ` Jonathan Cameron
2023-10-17 14:00 ` Peter Rosin
2023-10-17 19:27 ` Jonathan Cameron [this message]
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=20231017202729.30f2927f@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@Huawei.com \
--cc=lars@metafoo.de \
--cc=liambeguin@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
/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