diff --git a/device-caiman.mk b/device-caiman.mk index 5142e82e..c7e429df 100644 --- a/device-caiman.mk +++ b/device-caiman.mk @@ -213,6 +213,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/device-caimito-common.mk b/device-caimito-common.mk index 164bc639..9077f607 100644 --- a/device-caimito-common.mk +++ b/device-caimito-common.mk @@ -26,7 +26,8 @@ PRODUCT_COPY_FILES += \ ifneq (,$(filter $(TARGET_DEVICE),komodo caiman tokay)) PRODUCT_COPY_FILES += \ - $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite endif # Power HAL config diff --git a/device-komodo.mk b/device-komodo.mk index 2da4511c..e301e941 100644 --- a/device-komodo.mk +++ b/device-komodo.mk @@ -229,6 +229,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/device-tokay.mk b/device-tokay.mk index 38160696..c53e0fe3 100644 --- a/device-tokay.mk +++ b/device-tokay.mk @@ -213,6 +213,10 @@ PRODUCT_PACKAGES += \ # Display LBE PRODUCT_DEFAULT_PROPERTY_OVERRIDES += vendor.display.lbe.supported=1 +#Thermal VT estimator +PRODUCT_PACKAGES += \ + libthermal_tflite_wrapper + # Set zram size PRODUCT_VENDOR_PROPERTIES += \ vendor.zram.size=50p \ diff --git a/thermal/thermal_info_config_caiman.json b/thermal/thermal_info_config_caiman.json index 35be56b8..bb56b09b 100644 --- a/thermal/thermal_info_config_caiman.json +++ b/thermal/thermal_info_config_caiman.json @@ -255,6 +255,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_caiman_proto.json b/thermal/thermal_info_config_caiman_proto.json index ff7166b2..35b426f8 100644 --- a/thermal/thermal_info_config_caiman_proto.json +++ b/thermal/thermal_info_config_caiman_proto.json @@ -245,6 +245,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm", "soc_therm", "charging_therm", "disp_therm", "battery", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_komodo.json b/thermal/thermal_info_config_komodo.json index 92f7c67f..b337229f 100644 --- a/thermal/thermal_info_config_komodo.json +++ b/thermal/thermal_info_config_komodo.json @@ -288,6 +288,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_komodo_proto.json b/thermal/thermal_info_config_komodo_proto.json index 35fdc999..e6be4d59 100644 --- a/thermal/thermal_info_config_komodo_proto.json +++ b/thermal/thermal_info_config_komodo_proto.json @@ -278,6 +278,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_tokay.json b/thermal/thermal_info_config_tokay.json index 39d571db..8f7491a8 100644 --- a/thermal/thermal_info_config_tokay.json +++ b/thermal/thermal_info_config_tokay.json @@ -233,6 +233,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/thermal_info_config_tokay_proto.json b/thermal/thermal_info_config_tokay_proto.json index 781be927..0013a582 100644 --- a/thermal/thermal_info_config_tokay_proto.json +++ b/thermal/thermal_info_config_tokay_proto.json @@ -197,7 +197,6 @@ "Offset": 4130.0, "Multiplier": 0.001 }, - { "Name":"VIRTUAL-SKIN", "Type":"SKIN", @@ -224,6 +223,22 @@ } ] }, + { + "Name":"VIRTUAL-SKIN-MODEL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "ModelPath":"vt_estimation_model.tflite", + "TriggerSensor":["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "btmspkr_therm"], + "Formula":"USE_ML_MODEL", + "Combination":["north_therm","soc_therm","charging_therm","disp_therm","battery","quiet_therm","usb_pwr_therm","rfpa_therm","btmspkr_therm"], + "Coefficient":[1.0], + "HotThreshold":["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "Multiplier":0.001, + "SendPowerHint":true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, { "Name":"VIRTUAL-SKIN-HINT", "Type":"UNKNOWN", diff --git a/thermal/vt_estimation_model_caiman.tflite b/thermal/vt_estimation_model_caiman.tflite new file mode 100644 index 00000000..dd6d8beb Binary files /dev/null and b/thermal/vt_estimation_model_caiman.tflite differ diff --git a/thermal/vt_estimation_model_komodo.tflite b/thermal/vt_estimation_model_komodo.tflite new file mode 100644 index 00000000..14e68a2b Binary files /dev/null and b/thermal/vt_estimation_model_komodo.tflite differ diff --git a/thermal/vt_estimation_model_tokay.tflite b/thermal/vt_estimation_model_tokay.tflite new file mode 100644 index 00000000..bb71f0fe Binary files /dev/null and b/thermal/vt_estimation_model_tokay.tflite differ