HwmonTempSensor: Add support for PT5161L
Add support for PT5161L temperature sensor.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?h=hwmon-next&id=1b2ca93cd0592b1fcbc6f8b64e02552bc15f4bb4
Tested Result:
- MB_RETIMER0_TEMP_C sensor config from harma_mb.json
```
{
"Address": "0x24",
"Bus": 12,
"Name": "MB_RETIMER0_TEMP_C",
"PowerState": "On",
"Thresholds": [
{
"Direction": "greater than",
"Name": "upper critical",
"Severity": 1,
"Value": 107
},
{
"Direction": "greater than",
"Name": "upper non critical",
"Severity": 0,
"Value": 105
},
{
"Direction": "less than",
"Name": "lower non critical",
"Severity": 0,
"Value": 5
},
{
"Direction": "less than",
"Name": "lower critical",
"Severity": 1,
"Value": -7
}
],
"Type": "PT5161L"
}
```
- MB_RETIMER0_TEMP_C sensor reading
```
root@bmc:~# busctl introspect xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/MB_RETIMER0_TEMP_C
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
xyz.openbmc_project.Association.Definitions interface - - -
.Associations property a(sss) 1 "chassis" "all_sensors" "/xyz/openbmc… emits-change
xyz.openbmc_project.Sensor.Threshold.Critical interface - - -
.CriticalAlarmHigh property b false emits-change
.CriticalAlarmLow property b false emits-change
.CriticalHigh property d 107 emits-change writable
.CriticalLow property d -7 emits-change writable
xyz.openbmc_project.Sensor.Threshold.Warning interface - - -
.WarningAlarmHigh property b false emits-change
.WarningAlarmLow property b false emits-change
.WarningHigh property d 105 emits-change writable
.WarningLow property d 5 emits-change writable
xyz.openbmc_project.Sensor.Value interface - - -
.MaxValue property d 127 emits-change
.MinValue property d -128 emits-change
.Unit property s "xyz.openbmc_project.Sensor.Value.Unit.… emits-change
.Value property d 55.6 emits-change writable
xyz.openbmc_project.State.Decorator.Availability interface - - -
.Available property b true emits-change writable
xyz.openbmc_project.State.Decorator.OperationalStatus interface - - -
.Functional property b true emits-change
```
Change-Id: Ie0e7e9603c2e201a06a64de7c265500b73b5156d
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index 57730bf..e76ef18 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -69,6 +69,7 @@
{"MCP9600", I2CDeviceType{"mcp9600", false}},
{"NCT6779", I2CDeviceType{"nct6779", true}},
{"NCT7802", I2CDeviceType{"nct7802", true}},
+ {"PT5161L", I2CDeviceType{"pt5161l", true}},
{"SBTSI", I2CDeviceType{"sbtsi", true}},
{"SI7020", I2CDeviceType{"si7020", false}},
{"TMP100", I2CDeviceType{"tmp100", true}},