commit | 5636d52baad683fbb51447a716d66cb06959e52f | [log] [tgz] |
---|---|---|
author | Matt Spinler <spinler@us.ibm.com> | Wed Mar 17 14:52:18 2021 -0500 |
committer | Ed Tanous <ed@tanous.net> | Mon May 10 14:52:17 2021 +0000 |
tree | ad9607a652f1d815d7ac955523879e2988f3b3e7 | |
parent | b89967ffa471f235ea3ab8608ddb6ed8ee687265 [diff] |
HwmonTempSensor: Thresholds for multi-temp devices This commit adds support to be able to create the Threshold interfaces for the additional temperature sensors on multi-sensor devices. Previously, there could only be a threshold on the first sensor on the device. In some sensors, such as the TMP401 family, the remote sensors which can be wired to other devices are the temp2+_input values and it's likely those remote values are the interesting ones, as opposed to just the local temp in temp1_input. To specify thresholds for multiple sensors on the device, the 'Index' property is added to the entity-manager JSON for the sensor. When the index is present, code matches that threshold entry with the sensor that has an input file with that index number in the tempX prefix. For example, Index = 2 would be used for the sensor that has temp2_input as the sensor value file. Example JSON is: { "Index": 1 // This threshold is for the temp1_input sensor "Direction": "greater than", "Name": "upper critical", "Severity": 1, "Value": 70, }, { "Index": 2 // This threshold is for the temp2_input sensor "Direction": "greater than", "Name": "upper critical", "Severity": 1, "Value": 80, } If 'Index' is not present in the threshold data from entity-manager, then just the first sensor will get the threshold, the same as before. Tested: Made sensors for a TMP423 which provides 4 temperature values. Verified thresholds showed up on each sensor when 'Index' was used. Verified when less then 4 thresholds were specified that they were placed appropriately. Also used just a single Threshold entry with no Index value and verified the threshold just showed up on the first sensor. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: If787364761647088174cb72006727ee4e1d9225f
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access