openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Looking for clarification on sysfs IIO devices, do _raw devices require both _offset and _scale?
@ 2021-09-08 22:10 Bruce Mitchell
  2021-09-09  7:12 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Mitchell @ 2021-09-08 22:10 UTC (permalink / raw)
  To: linux-iio; +Cc: openbmc, Ed Tanous, Ed Tanous

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-13  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 22:10 Looking for clarification on sysfs IIO devices, do _raw devices require both _offset and _scale? Bruce Mitchell
2021-09-09  7:12 ` Lars-Peter Clausen
2021-09-09 13:49   ` Bruce Mitchell

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).