Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ def __init__(self, thermal_index):
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 + '/'

# ADT7473 temperature sensors
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
hwmon_node = os.listdir(i2c_path)[0]
self.SENSOR_DIR = i2c_path + hwmon_node + '/'

# 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 + '/'

Expand All @@ -72,16 +72,16 @@ def __init__(self, thermal_index):
+ "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

Expand Down