From: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
To: linux-iio@vger.kernel.org
Cc: "openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
Ed Tanous <ed@tanous.net>, Ed Tanous <edtanous@google.com>
Subject: Looking for clarification on sysfs IIO devices, do _raw devices require both _offset and _scale?
Date: Wed, 8 Sep 2021 15:10:29 -0700 [thread overview]
Message-ID: <cc74f30f-9ab8-45ce-1f44-8e55c3f9c5ce@linux.vnet.ibm.com> (raw)
In reference to:
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio
I have Temperature, Pressure, and Humidity IIO sensors.
IIO _raw devices look like this on sysfs:
this happens to be a SI7020 type device with 2 sensors
/sys/bus/iio/devices/iio:device0/in_humidityrelative_offset
/sys/bus/iio/devices/iio:device0/in_humidityrelative_raw
/sys/bus/iio/devices/iio:device0/in_humidityrelative_scale
/sys/bus/iio/devices/iio:device0/in_temp_offset
/sys/bus/iio/devices/iio:device0/in_temp_raw
/sys/bus/iio/devices/iio:device0/in_temp_scale
Other IIO _input devices look like this on sysfs:
this happens to be a DPS310 device with 2 sensors
/sys/bus/iio/devices/iio:device1/in_temp_input
/sys/bus/iio/devices/iio:device1/in_pressure_input
As I read it if the IIO device was an _input type on sysfs,
just read it (and possibly scale it for units).
But if the IIO device was a _raw type on sysfs my understanding
is that it must be accompanied by a _offset and a _scale for
at least temperature, pressure, humidity, voltage, and current
sensors.
Is that correct?
Further for any IIO device that is a _raw type on sysfs is it
required to be accompanied by a _offset and a _scale as well?
Thank you!
--
Bruce
next reply other threads:[~2021-09-08 22:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-08 22:10 Bruce Mitchell [this message]
2021-09-09 7:12 ` Looking for clarification on sysfs IIO devices, do _raw devices require both _offset and _scale? Lars-Peter Clausen
2021-09-09 13:49 ` Bruce Mitchell
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=cc74f30f-9ab8-45ce-1f44-8e55c3f9c5ce@linux.vnet.ibm.com \
--to=bruce.mitchell@linux.vnet.ibm.com \
--cc=ed@tanous.net \
--cc=edtanous@google.com \
--cc=linux-iio@vger.kernel.org \
--cc=openbmc@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).