From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Peter Rosin <peda@axentia.se>,
Jonathan Cameron <jic23@kernel.org>,
linux-iio <linux-iio@vger.kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH] iio: afe: iio-rescale: Support processed channels
Date: Mon, 4 Jan 2021 17:11:14 +0000 [thread overview]
Message-ID: <20210104171114.000042df@Huawei.com> (raw)
In-Reply-To: <CACRpkdbOx0AiFOejZ5gtjQwQNo-qzuRRNVDhjAbAk1pGLMj8Yw@mail.gmail.com>
On Mon, 4 Jan 2021 15:45:07 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Dec 14, 2020 at 5:34 PM Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> > On Mon, 14 Dec 2020 16:30:22 +0100 Peter Rosin <peda@axentia.se> wrote:
>
> > > >> And that gets transformed by the
> > > >> rescaler into the processed values being presented as raw, with rescaling
> > > >> added on top, but with the read_avail info for this new raw channel being
> > > >> completely wrong.
> > > >>
> > > >> For the intended driver (ab8500-gpadc) this is not the case (it has no
> > > >> read_avail for its raw channel). But it does have a raw channel, so adding
> > > >> read_avail seems easy and I can easily see other drivers already doing it.
> > > >> Haven't checked that though...
> > > >
> > > > Drat. I'd failed to register this is one of those corner cases.
> > >
> > > I'm not sure, I just browsed the code. Maybe I misread it?
> >
> > It's doing both - you were right. I think there are only a small number of
> > drivers that have that history.
> >
> > Looks superficially like it's easy enough to catch this corner case and
> > block it - so lets do that.
>
> Sorry if I am a bit confused here. I don't understand what I am supposed
> to do to proceed with using this driver with the ab8500 GPADC...
>
> Shall I fix something in the AB8500 GPADC as a prerequisite?
> In that case I think I need some more pointers...
I confess I'm a bit lost, but I 'think' the problem we had
left was around read_avail which doesn't play well if we
it defined for the _raw value in the provider, but not the _processed value.
So if we detect their is a _processed channel (which we are going to use) we
just need to make sure that we don't pass the read_avail for _raw through
to be exposed by the rescale driver as the consumer as it will be garbage.
Best plan is probably to just pretend the read_avail for the provider doesn't
exist in this case.
@Peter, does that cover it of are there other similar cases?
It definitely also wants a big fat comment saying why we are hiding this!
Jonathan
>
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2021-01-04 17:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 23:22 [PATCH] iio: afe: iio-rescale: Support processed channels Linus Walleij
2020-11-15 11:21 ` Linus Walleij
2020-11-15 17:44 ` Jonathan Cameron
2020-11-16 8:18 ` Peter Rosin
2020-12-13 12:12 ` Jonathan Cameron
2020-12-12 12:26 ` Linus Walleij
2020-12-12 23:22 ` Peter Rosin
2020-12-13 12:16 ` Jonathan Cameron
2020-12-14 8:34 ` Peter Rosin
2020-12-14 15:07 ` Jonathan Cameron
2020-12-14 15:30 ` Peter Rosin
2020-12-14 16:34 ` Jonathan Cameron
2021-01-04 14:45 ` Linus Walleij
2021-01-04 17:11 ` Jonathan Cameron [this message]
2021-01-04 18:09 ` Peter Rosin
2020-12-13 15:16 ` Andy Shevchenko
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=20210104171114.000042df@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=peda@axentia.se \
--cc=pmeerw@pmeerw.net \
/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;
as well as URLs for NNTP newsgroup(s).