Enhancement to support GAIN and OFFSET value for sensor reading

For example, AST BMC chips ADC input voltage range is 0 to 2.5V,
good nominal input voltage is 1.8V. Other voltages are scaled into
that range using external resistors(ADC voltage divider).

Since the values of these resistors can change from their own
motherboard design, the conversions cannot be hard coded into
the Linux driver and have to be done in user space.

In the sensor configuration file, add the GAIN_in[0-*] and OFFSET_in[0-*]
value.
The sensor reading conversion can be:

    value = (raw sensor reading) * gain + offset

Resolves: openbmc/openbmc#2259

Change-Id: I2502c656e0d34dd69b9c795788505f209a77a72b
Signed-off-by: Chiabing Lee <chiabinglee@gmail.com>
Signed-off-by: Lei YU <mine260309@gmail.com>
1 file changed
tree: 32e9785ad3bde8f6360e22365889a6fad3f28957
  1. msl/
  2. test/
  3. .gitignore
  4. argument.cpp
  5. argument.hpp
  6. bootstrap.sh
  7. configure.ac
  8. env.cpp
  9. env.hpp
  10. fan_speed.cpp
  11. fan_speed.hpp
  12. hwmon.hpp
  13. interface.hpp
  14. LICENSE
  15. mainloop.cpp
  16. mainloop.hpp
  17. Makefile.am
  18. readd.cpp
  19. README.iio.md
  20. README.md
  21. sensorset.cpp
  22. sensorset.hpp
  23. sysfs.cpp
  24. sysfs.hpp
  25. targets.hpp
  26. thresholds.hpp
  27. util.hpp
README.md

Exposes generic hwmon entries as DBus objects.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To full clean the repository again run `./bootstrap.sh clean`.