From dade9ed2ac491a3bc1bf309ca8abfce792bed625 Mon Sep 17 00:00:00 2001 From: Sayanna Chandula Date: Thu, 31 Mar 2022 18:17:19 +0000 Subject: [PATCH] thermal: add usbc virtual sensors for overheat protection Add a virtual sensor for USBC overheat protection and messaging to UI. Bind overheat protection sensor with USBC cooling device. Bug: 222577017 Test: Build and boot on device Signed-off-by: Sayanna Chandula Change-Id: I6f3cdc01fedfd152382a2d5370e22e0acf6cb3ba --- thermal_info_config_cheetah.json | 125 ++++++++++++++++++++++++++++++- thermal_info_config_panther.json | 125 ++++++++++++++++++++++++++++++- 2 files changed, 246 insertions(+), 4 deletions(-) diff --git a/thermal_info_config_cheetah.json b/thermal_info_config_cheetah.json index 04530fa..6d369fe 100644 --- a/thermal_info_config_cheetah.json +++ b/thermal_info_config_cheetah.json @@ -95,7 +95,7 @@ "Type":"UNKNOWN", "HotThreshold":[ "NAN", - "NAN", + "35.0", "NAN", "NAN", "NAN", @@ -111,7 +111,7 @@ "Type":"UNKNOWN", "HotThreshold":[ "NAN", - "35.0", + "NAN", "NAN", "NAN", "NAN", @@ -458,6 +458,123 @@ "PollingDelay":300000, "PassiveDelay":7000 }, + { + "Name":"USB-MINUS-USB2", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm", + "usb_pwr_therm2" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"USB-MINUS-NEUTRAL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm", + "neutral_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_therm", + "Combination":[ + "usb_pwr_therm", + "USB-MINUS-USB2", + "USB-MINUS-NEUTRAL" + ], + "Coefficient":[ + "42000", + "4000", + "7000" + ], + "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_therm", + "Combination":[ + "usb_pwr_therm", + "USB-MINUS-USB2", + "USB-MINUS-NEUTRAL" + ], + "Coefficient":[ + "47000", + "4500", + "8000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":1, + "Monitor":true, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"LITTLE", "Type":"CPU", @@ -1249,6 +1366,10 @@ "Name":"wlc_fcc", "Type":"BATTERY" }, + { + "Name":"usbc-port", + "Type":"BATTERY" + }, { "Name":"tpu_cooling", "Type":"NPU", diff --git a/thermal_info_config_panther.json b/thermal_info_config_panther.json index f698199..65ea98a 100644 --- a/thermal_info_config_panther.json +++ b/thermal_info_config_panther.json @@ -68,7 +68,7 @@ "Type":"UNKNOWN", "HotThreshold":[ "NAN", - "NAN", + "35.0", "NAN", "NAN", "NAN", @@ -84,7 +84,7 @@ "Type":"UNKNOWN", "HotThreshold":[ "NAN", - "35.0", + "NAN", "NAN", "NAN", "NAN", @@ -458,6 +458,123 @@ "PollingDelay":300000, "PassiveDelay":7000 }, + { + "Name":"USB-MINUS-USB2", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm", + "usb_pwr_therm2" + ], + "Coefficient":[ + "1.0", + "-1.0" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"USB-MINUS-NEUTRAL", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":[ + "usb_pwr_therm", + "neutral_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_therm", + "Combination":[ + "usb_pwr_therm", + "USB-MINUS-USB2", + "USB-MINUS-NEUTRAL" + ], + "Coefficient":[ + "40000", + "1500", + "3000" + ], + "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_therm", + "Combination":[ + "usb_pwr_therm", + "USB-MINUS-USB2", + "USB-MINUS-NEUTRAL" + ], + "Coefficient":[ + "42000", + "2000", + "4000" + ], + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "3.0", + "NAN" + ], + "VrThreshold":"NAN", + "Multiplier":1, + "Monitor":true, + "PollingDelay":60000, + "PassiveDelay":7000 + }, { "Name":"LITTLE", "Type":"CPU", @@ -1249,6 +1366,10 @@ "Name":"wlc_fcc", "Type":"BATTERY" }, + { + "Name":"usbc-port", + "Type":"BATTERY" + }, { "Name":"tpu_cooling", "Type":"NPU",