summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-08-05 01:08:18 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-08-05 01:08:18 +0000
commitb32c28352dc622241998e46e672a5142b1a5e9d2 (patch)
tree5268eff6e5ddd9fdad341a8feabcd8a48d4a94ba
parent94c1cfb814a007a8873176f3fbebd4fe2d3f6846 (diff)
parent0e73536681c59ef1dca9dc7fc289935c9ff83dc3 (diff)
downloadpixel-b32c28352dc622241998e46e672a5142b1a5e9d2.tar.gz
Snap for 7612197 from 0e73536681c59ef1dca9dc7fc289935c9ff83dc3 to sc-release
Change-Id: I0d2a634c4c3ab3fb4040efb1d4fe9dd7220ddf6a
-rw-r--r--thermal/thermal-helper.cpp10
-rw-r--r--thermal/utils/config_parser.cpp7
-rw-r--r--thermal/utils/config_parser.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/thermal/thermal-helper.cpp b/thermal/thermal-helper.cpp
index ea797d70..b6c374fe 100644
--- a/thermal/thermal-helper.cpp
+++ b/thermal/thermal-helper.cpp
@@ -808,8 +808,14 @@ bool ThermalHelper::initializeSensorMap(
LOG(ERROR) << "Could not find " << sensor_name << " in sysfs";
return false;
}
- std::string path = android::base::StringPrintf(
- "%s/%s", path_map.at(sensor_name.data()).c_str(), kSensorTempSuffix.data());
+
+ std::string path;
+ if (sensor_info_pair.second.temp_path.empty()) {
+ path = android::base::StringPrintf("%s/%s", path_map.at(sensor_name.data()).c_str(),
+ kSensorTempSuffix.data());
+ } else {
+ path = sensor_info_pair.second.temp_path;
+ }
if (!thermal_sensors_.addThermalFile(sensor_name, path)) {
LOG(ERROR) << "Could not add " << sensor_name << "to sensors map";
diff --git a/thermal/utils/config_parser.cpp b/thermal/utils/config_parser.cpp
index 96aff370..6216dd73 100644
--- a/thermal/utils/config_parser.cpp
+++ b/thermal/utils/config_parser.cpp
@@ -360,6 +360,12 @@ std::unordered_map<std::string, SensorInfo> ParseSensorInfo(std::string_view con
}
}
+ std::string temp_path;
+ if (!sensors[i]["TempPath"].empty()) {
+ temp_path = sensors[i]["TempPath"].asString();
+ LOG(INFO) << "Sensor[" << name << "]'s TempPath: " << temp_path;
+ }
+
float vr_threshold = NAN;
vr_threshold = getFloatFromValue(sensors[i]["VrThreshold"]);
LOG(INFO) << "Sensor[" << name << "]'s VrThreshold: " << vr_threshold;
@@ -655,6 +661,7 @@ std::unordered_map<std::string, SensorInfo> ParseSensorInfo(std::string_view con
.cold_thresholds = cold_thresholds,
.hot_hysteresis = hot_hysteresis,
.cold_hysteresis = cold_hysteresis,
+ .temp_path = temp_path,
.vr_threshold = vr_threshold,
.multiplier = multiplier,
.polling_delay = polling_delay,
diff --git a/thermal/utils/config_parser.h b/thermal/utils/config_parser.h
index 194b7446..db941c95 100644
--- a/thermal/utils/config_parser.h
+++ b/thermal/utils/config_parser.h
@@ -102,6 +102,7 @@ struct SensorInfo {
ThrottlingArray cold_thresholds;
ThrottlingArray hot_hysteresis;
ThrottlingArray cold_hysteresis;
+ std::string temp_path;
float vr_threshold;
float multiplier;
std::chrono::milliseconds polling_delay;