From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bastien Nocera <hadess@hadess.net>,
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: event_monitor: Enable events before monitoring
Date: Sun, 7 Mar 2021 11:54:58 +0000 [thread overview]
Message-ID: <20210307115458.2be0854b@archlinux> (raw)
In-Reply-To: <CACRpkdaNWyQhdCDOHmRA6yWyeSXfi1WBBUauR73wdVTtFOjfUA@mail.gmail.com>
On Sat, 6 Mar 2021 22:29:41 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sat, Mar 6, 2021 at 4:39 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> > Sadly this doesn't work for many devices.
> > It is a common thing for hardware to only support a much smaller
> > set of event monitoring registers / threshold detectors than the
> > number of channels. In many cases we handle that by working on
> > a fifo basis. So what this will do is enable a bunch of events
> > which will then be replaced by later events - end result some
> > random event will be enabled (or maybe 2 of them across N channels)
>
> I understand.
>
> What about augmenting the heuristics like this:
>
> 1. Count the available events.
> 2. If they are just one, then enable that event and disable after use.
>
> This will make all proximity sensors and other things that just
> provide a single event work out of the box.
Rather unintuitive interface. I think we are better off just
adding a -a parameter like we have for the buffer example.
If people get used to it enabling sensible events for a simple device
then move on to a more complex one where the heuristic breaks down
then they will be very confused.
J
>
> Yours,
> Linus Walleij
prev parent reply other threads:[~2021-03-07 11:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 15:42 [PATCH] iio: event_monitor: Enable events before monitoring Linus Walleij
2021-03-04 15:59 ` Bastien Nocera
2021-03-04 20:48 ` Linus Walleij
2021-03-06 15:39 ` Jonathan Cameron
2021-03-06 21:29 ` Linus Walleij
2021-03-07 11:54 ` 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=20210307115458.2be0854b@archlinux \
--to=jic23@kernel.org \
--cc=hadess@hadess.net \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--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