From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Stefan Lengfeld <stefan.lengfeld@inovex.de>,
linux-iio <linux-iio@vger.kernel.org>
Subject: Re: Questions: IIO type for absorbance and float values in channels?
Date: Tue, 21 Jun 2022 20:26:45 +0100 [thread overview]
Message-ID: <20220621202645.1dd9f22f@jic23-huawei> (raw)
In-Reply-To: <CAHp75VeN=C7Uy+a9fBMX8NBO2nFLeAFjjpTdZX-y8K2enxMdiw@mail.gmail.com>
On Tue, 21 Jun 2022 16:13:25 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Tue, Jun 21, 2022 at 2:29 PM Jonathan Cameron
> <Jonathan.Cameron@huawei.com> wrote:
> > On Tue, 21 Jun 2022 14:18:55 +0200
> > Stefan Lengfeld <stefan.lengfeld@inovex.de> wrote:
>
> ...
>
> > > Question 1:
> > >
> > > The sensor measures the absorbance[1] of a material. It's the negative
> > > logarithmic quotient of the received and emitted light. It's a unit-less value.
> > >
> > > As far as I can see there is currently no predefined IIO type in the kernel for
> > > this. I have search the list [2], but nothing matches.
> > >
> > > Do I overlook something or what channel type should I use for this sensor
> > > measurement value?
> >
> > So the closest we've seen to this is some of the health sensors (pulse oximeter
> > targeting devices) but in that case the processing is done with a custom userspace
> > library so we just pass values on in fixed point.
> >
> > So probably needs a new channel type.
>
> Wouldn't this be a particular case of ambient (light) sensor?
>
Not IIO_LIGHT / illuminance (which is the human eye profile corrected light reading we
tend to care about), but could probably be considered intensity
with a modifier. The snag is we have colour modifiers for that and so
this is one of those corner cases where we would ideally allow
modifiers to stack, but we don't (and can't retrofit that because
of the space in the IIO_EVENT definition - there is no where to
put it :( So it is like illuminance in the sense that it is a computed
value (or that's one implementation anyway) based on intensity channels.
I've never seen a sensor actually measure illuminance directly - they tend
to combine multiple sensors with different frequency responses using some
secret sauce (or attempt to bodge something reasonable from one reading based
on assumptions about the light source). Arguably it's also like the
proximity devices that just use intensity of response relative to a light
source the control (the cheap ones :)
There isn't really a good answer as there is a bit too much to describe about this
channel type...
Jonathan
next prev parent reply other threads:[~2022-06-21 19:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 12:18 Questions: IIO type for absorbance and float values in channels? Stefan Lengfeld
2022-06-21 12:29 ` Jonathan Cameron
2022-06-21 14:13 ` Andy Shevchenko
2022-06-21 19:26 ` Jonathan Cameron [this message]
2022-06-22 15:42 ` Stefan Lengfeld
2022-06-25 13:21 ` Jonathan Cameron
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=20220621202645.1dd9f22f@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=stefan.lengfeld@inovex.de \
/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