Expose USB-C thermistor in ThermalHAL for Wahoo.

Expose USB-C to calls to getTemperatures() in ThermalHAL for wahoo.

Bug: 67749183
Test: VtsHalThermalV1_0TargetTest pass
Change-Id: Ic45dea1c990e0c71a6ac621145b93cb0f7aa9519
This commit is contained in:
Miguel de Dios
2018-03-07 17:21:45 -08:00
parent 5fa2e560d5
commit 51872d4950
2 changed files with 16 additions and 2 deletions

View File

@@ -200,6 +200,18 @@ ssize_t fillTemperatures(hidl_vec<Temperature> *temperatures) {
}
current_index++;
}
// USB-C temperature.
if (current_index < temperatures->size()) {
// temperature in Celsius.
result = readTemperature(
kUsbcSensorNum, TemperatureType::UNKNOWN, kUsbcLabel, 0.1, NAN, NAN,
NAN, &(*temperatures)[current_index]);
if (result < 0) {
return result;
}
current_index++;
}
return kTemperatureNum;
}

View File

@@ -69,17 +69,19 @@ constexpr unsigned int kTaimenRcVrThrottledBelowMin = 50;
constexpr unsigned int kBatterySensorNum = 0;
constexpr unsigned int kUsbcSensorNum = 5;
constexpr unsigned int kGpuTsensOffset = 11;
constexpr unsigned int kCpuNum = 8;
constexpr const char *kGpuLabel = "GPU";
constexpr const char *kBatteryLabel = "battery";
constexpr const char *kSkinLabel = "skin";
constexpr const char *kUsbcLabel = "usbc";
constexpr const char *kCpuLabel[kCpuNum] = {"CPU0", "CPU1", "CPU2", "CPU3", "CPU4", "CPU5", "CPU6", "CPU7"};
constexpr int kCpuTsensOffset[kCpuNum] = {1, 2, 4, 3, 5, 6, 7, 8};
// Sum of kCpuNum + 3 for GPU, BATTERY, and SKIN.
constexpr unsigned int kTemperatureNum = 3 + kCpuNum;
// Sum of kCpuNum + 4 for GPU, BATTERY, SKIN, and USB-C.
constexpr unsigned int kTemperatureNum = 4 + kCpuNum;
// qcom, therm-reset-temp
constexpr unsigned int kCpuShutdownThreshold = 115;