From 1b6d959f9da5980ff88e921bf6bfd34d61554298 Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Fri, 9 Jul 2021 16:21:33 +0800 Subject: [PATCH] thermal: Enable usb port overheat protection Bug: 183573049 Test: Veirfied with emul temp Change-Id: I6235228b06938e5a33ad64b07bd69f50846a78d4 --- thermal_info_config_oriole.json | 140 +++++++++++++++++++++++++++++++- thermal_info_config_raven.json | 140 +++++++++++++++++++++++++++++++- 2 files changed, 278 insertions(+), 2 deletions(-) diff --git a/thermal_info_config_oriole.json b/thermal_info_config_oriole.json index 395a690..58ac51e 100644 --- a/thermal_info_config_oriole.json +++ b/thermal_info_config_oriole.json @@ -91,7 +91,7 @@ "Multiplier":0.001 }, { - "Name":"usb_pwr_therm2", + "Name":"usb_pwr_therm", "Type":"UNKNOWN", "HotThreshold":[ "NAN", @@ -105,6 +105,23 @@ "VrThreshold":"NAN", "Multiplier":0.001 }, + { + "Name":"usb_pwr_therm2", + "Type":"UNKNOWN", + "HotThreshold":[ + "NAN", + "35.0", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"disp_therm", "Type":"UNKNOWN", @@ -402,6 +419,123 @@ "PollingDelay":300000, "PassiveDelay":7000 }, + { + "Name":"USB2-MINUS-USB", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm2", + "usb_pwr_therm" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"USB2-MINUS-QI", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm2", + "qi_therm" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-USB-THROTTLING", + "Type":"USB_PORT", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "TriggerSensor": "usb_pwr_therm2", + "Combination":[ + "usb_pwr_therm2", + "USB2-MINUS-USB", + "USB2-MINUS-QI" + ], + "Coefficient":[ + "35000", + "2000", + "10000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN", + "NAN" + ], + "BindedCdevInfo": [ + { + "CdevRequest": "usbc-port", + "LimitInfo": [0, 0, 0, 0, 1, 1, 1] + } + ], + "VrThreshold":"NAN", + "Multiplier":1, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"VIRTUAL-USB-UI", + "Type":"USB_PORT", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "TriggerSensor": "usb_pwr_therm2", + "Combination":[ + "usb_pwr_therm2", + "USB2-MINUS-USB", + "USB2-MINUS-QI" + ], + "Coefficient":[ + "35000", + "3000", + "12000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":1, + "Monitor":true, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"LITTLE", "Type":"CPU", @@ -789,6 +923,10 @@ { "Name":"wlc_fcc", "Type":"BATTERY" + }, + { + "Name":"usbc-port", + "Type":"BATTERY" } ], "PowerRails":[ diff --git a/thermal_info_config_raven.json b/thermal_info_config_raven.json index bedf2fe..2e05f0f 100644 --- a/thermal_info_config_raven.json +++ b/thermal_info_config_raven.json @@ -108,7 +108,7 @@ "PassiveDelay":7000 }, { - "Name":"usb_pwr_therm2", + "Name":"usb_pwr_therm", "Type":"UNKNOWN", "HotThreshold":[ "NAN", @@ -122,6 +122,23 @@ "VrThreshold":"NAN", "Multiplier":0.001 }, + { + "Name":"usb_pwr_therm2", + "Type":"UNKNOWN", + "HotThreshold":[ + "NAN", + "35.0", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"disp_therm", "Type":"UNKNOWN", @@ -402,6 +419,123 @@ "PollingDelay":300000, "PassiveDelay":7000 }, + { + "Name":"USB2-MINUS-USB", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm2", + "usb_pwr_therm" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"USB2-MINUS-QI", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm2", + "qi_therm" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-USB-THROTTLING", + "Type":"USB_PORT", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "TriggerSensor": "usb_pwr_therm2", + "Combination":[ + "usb_pwr_therm2", + "USB2-MINUS-USB", + "USB2-MINUS-QI" + ], + "Coefficient":[ + "35000", + "3000", + "9000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN", + "NAN" + ], + "BindedCdevInfo": [ + { + "CdevRequest": "usbc-port", + "LimitInfo": [0, 0, 0, 0, 1, 1, 1] + } + ], + "VrThreshold":"NAN", + "Multiplier":1, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"VIRTUAL-USB-UI", + "Type":"USB_PORT", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "TriggerSensor": "usb_pwr_therm2", + "Combination":[ + "usb_pwr_therm2", + "USB2-MINUS-USB", + "USB2-MINUS-QI" + ], + "Coefficient":[ + "35000", + "4000", + "12000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":1, + "Monitor":true, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"LITTLE", "Type":"CPU", @@ -793,6 +927,10 @@ { "Name":"wlc_fcc", "Type":"BATTERY" + }, + { + "Name":"usbc-port", + "Type":"BATTERY" } ], "PowerRails":[