From: Jonathan Cameron <jic23@kernel.org>
To: Cengiz Can <cengiz@kernel.wtf>
Cc: "Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Alexandru Ardelean" <ardeleanalex@gmail.com>,
"Ekin Böke" <ekin_boke@arcelik.com>,
linux-iio@vger.kernel.org
Subject: Re: Control Register device tree binding request for Opt3001
Date: Sun, 21 Feb 2021 12:26:47 +0000 [thread overview]
Message-ID: <20210221122647.5bbbe19c@archlinux> (raw)
In-Reply-To: <4e0b8e47a2644d304b2d1e6b2e087136@kernel.wtf>
On Thu, 18 Feb 2021 15:38:15 +0300
Cengiz Can <cengiz@kernel.wtf> wrote:
> Hello Jonathan, Alexandru and Ekin
>
> On 2021-02-18 15:15, Jonathan Cameron wrote:
> >
> > As described, what you want to control here is policy, not a
> > characteristic
> > of the hardware. Normally we don't use DT to make such decisions, as
> > it should
> > be controlled at runtime.
>
> I'm by no means an expert on sensors and I don't fully understand the
> distinction
> of policy vs characteristic in this context.
>
> Can you clarify a bit?
It's a slightly blurred boundary, but to give some examples:
Characterstics - dependent on device, not where the device is
being used and mostly even what it is being used for.
- Wiring things - power supplies etc.
- Voltage limits etc (stuff that can damage hardware).
- Calibration parameter reflecting thing like plastic on top of a sensor.
- Proximity limits on devices intended to detect if a person is
near enough to a wifi antenna that we should reduce the power output.
(this one is an edge condition as it is assuming a 'usecase' but it
the value is based on the physical device).
Policy - stuff dependent on what sensor is being used for at a particular
point in time.
* Sensitivity levels / integration times etc - if you are in a dark environment
then these would ideally be set different to an outdoor usecase. Same device
may well move between these places.
* Thresholds that aren't a 'physical thing'. So stuff you'd expect to have
a userspace control for.
>
> For example, many TFT drivers allow maximum-minimum brightness values in
> devicetree
> and even set a default brightness value. Totally within the specs of
> vendor of course.
I'd guess they would have some connection to what actually makes sense
for a given physical device incorporating the TFT? Perhaps above the
max brightness screen always unreadable under all lighting conditions.
Also note that for DT bindings a lot of stuff was added back before there
was particularly good review or tight control of what was acceptable and
what was not. As we have to support bindings that are already in
the field, we can't rip that stuff out. We can avoid adding more though.
>
> Since this is just a hardware register that can be changed, and possibly
> never to be
> modified (depending on the use case of course) during runtime, I would
> like to be able
> to set it once during initialization and forget about it.
It's that question of usecase. There may well be devices that are only
ever used outside for example and hence need only one of the settings, but
it definitely isn't a common situation.
Whilst the amount of code needed to support this is small, there is
still a maintenance burden and a userspace script should be sufficient.
>
> Currently I have a oneshot systemd unit that echo's my desired
> integration value and
> I think that's a bit late for my application. (even with all the
> priority and orderings set).
I'm not sure I understand how doing it in systemd is too late?
It should be possible to ensure that it happens early enough
to support any userspace application.
Jonathan
>
> >
> > So basically what Alex said :)
> >
> > Jonathan
> >
>
> Thank you
>
prev parent reply other threads:[~2021-02-21 12:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 5:18 Control Register device tree binding request for Opt3001 Ekin Böke
2021-02-18 8:31 ` Matt Ranostay
2021-02-18 8:35 ` Alexandru Ardelean
2021-02-18 12:15 ` Jonathan Cameron
2021-02-18 12:38 ` Cengiz Can
2021-02-21 12:26 ` 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=20210221122647.5bbbe19c@archlinux \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=ardeleanalex@gmail.com \
--cc=cengiz@kernel.wtf \
--cc=ekin_boke@arcelik.com \
--cc=linux-iio@vger.kernel.org \
/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