[Nokia ixs7215] Platform API temperature threshold value fixes (#10533)

Incorrect high-threshold and critical-high-threshold values are displayed for
some of the temperature sensors. This commit fixes that.

Co-authored-by: Qi Luo <qiluo-msft@users.noreply.github.com>
Co-authored-by: Jing Kan <jika@microsoft.com>
This commit is contained in:
dflynn-Nokia 2022-04-24 21:28:13 -04:00 committed by GitHub
parent 48f5c0ebff
commit 44ec8372a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -30,7 +30,7 @@ def main():
high_thresh = "NA"
print(" Low Threshold(C): {}, High Threshold(C): {}".format(low_thresh,
high_thresh))
high_thresh))
try:
crit_low_thresh = thermal.get_low_critical_threshold()

View File

@ -44,8 +44,8 @@ class Thermal(ThermalBase):
if self.index < 3:
i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index - 1][0]
sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1]
sensor_max_suffix = "max"
sensor_crit_suffix = None
sensor_high_suffix = "max"
sensor_high_crit_suffix = None
hwmon_node = os.listdir(i2c_path)[0]
self.SENSOR_DIR = i2c_path + hwmon_node + '/'
@ -53,16 +53,16 @@ class Thermal(ThermalBase):
elif self.index < 6:
i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index - 1][0]
sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1]
sensor_max_suffix = "max"
sensor_crit_suffix = "crit"
sensor_high_suffix = "crit"
sensor_high_crit_suffix = None
self.SENSOR_DIR = i2c_path
# Armada 38x SOC temperature sensor
else:
dev_path = self.HWMON_CLASS_DIR
sensor_index = 1
sensor_max_suffix = None
sensor_crit_suffix = None
sensor_high_suffix = None
sensor_high_crit_suffix = None
hwmon_node = os.listdir(dev_path)[0]
self.SENSOR_DIR = dev_path + hwmon_node + '/'
@ -71,16 +71,16 @@ class Thermal(ThermalBase):
+ "temp{}_input".format(sensor_index)
# sysfs file for high threshold value if supported for this sensor
if sensor_max_suffix:
if sensor_high_suffix:
self.thermal_high_threshold_file = self.SENSOR_DIR \
+ "temp{}_{}".format(sensor_index, sensor_max_suffix)
+ "temp{}_{}".format(sensor_index, sensor_high_suffix)
else:
self.thermal_high_threshold_file = None
# sysfs file for crit high threshold value if supported for this sensor
if sensor_crit_suffix:
if sensor_high_crit_suffix:
self.thermal_high_crit_threshold_file = self.SENSOR_DIR \
+ "temp{}_{}".format(sensor_index, sensor_crit_suffix)
+ "temp{}_{}".format(sensor_index, sensor_high_crit_suffix)
else:
self.thermal_high_crit_threshold_file = None