summaryrefslogtreecommitdiff
path: root/thermalUtils.cpp
AgeCommit message (Collapse)Author
2023-03-09thermal-hal: add support for severity in HAL config for throttling thresholdPriyansh Jain
Add support to selectively configure thermal HAL severity for throttling threshold for any HAL config. Signed-off-by: Priyansh Jain <quic_priyjain@quicinc.com>
2020-12-28thermal-hal: Notify clients when they read temperatureRam Chandrasekar
Certain sensors like thermistor's, can read temperature higher than the threshold even before a threshold violation uevent. This is because certain thermistor's use comparator's to trigger threshold violation independent of the ADC used to read the temperature. In those corner case, thermal HAL can update the severity when a client is reading a temperature and not notify them. So when an actual uevent occurs, client notification will be skipped, because the severity wouldn't have changed. Update HAL to notify clients when the read temperature API see's the threshold violation first before the uevent. Change-Id: I30248b1364909a74b362fa732041c3f96917952c
2020-11-18thermal-hal: Update the common data object with the statusRam Chandrasekar
thermal-hal has a hash map storing all the sensor instances. Use the same instance to read and update the temperature, update the severity and determine the next threshold based on severity. Not using the same instance can lead to a situation where the information is updated in the local copy rather than in the global copy in the hash map. Also change the return signature of the estimateseverity function to return the new severity value if it is changed. Otherwise it will return -1. This provided a mechanism for the caller's to know if there is any change in severity for that sensor. Change-Id: I34c2a271b505fea969db6f4a04321e63c0181ea7
2020-08-31thermal-hal: Use correct threshold severity indexRam Chandrasekar
Use the correct threshold severity Index when populating and retrieving the threshold. Change-Id: Ifec69778e69d9d480018782ee446a12ab5089a10
2020-08-27thermal-hal: Return empty vector when a sensor is not supportedRam Chandrasekar
Right now the thermal HAL will return a temperature, temperature threshold and cooling device entry with a NAN value for a sensor that is not supported. This will break the VTS test case, which expects an empty vector in that case. Change the thermal HAL to return empty vector in case the sensor is not supported. Also populate the thresholds value for CPU, GPU, Battery and skin sensors for the V1.0 getTemperature API. Make sure that the threshold values are also read in degree celsius. Change-Id: I82ab1e9dd9672f1b93760e93b55e8943fc5acce0
2020-08-06thermal-hal: Re-size cpu usage vector based on cpu countRam Chandrasekar
Re-size cpu usage vector to cpu count size before filling in the data. This will ensure that sufficient memory is allocated before populating the data. Change-Id: I7a1d109cf3ec8403ca61beed9a9eab4287a3d33c
2020-07-09thermal-hal: Add support for HAL2.0Ram Chandrasekar
Add support for thermal HAL 2.0 interfaces. Also add support for HAL 1.0 interfaces to be backward compatible. Change-Id: Ib0be008605db2751bda21f537ea694b3f9849800