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 <sayanna@google.com>
Change-Id: I6f3cdc01fedfd152382a2d5370e22e0acf6cb3ba
This commit is contained in:
Sayanna Chandula 2022-03-31 18:17:19 +00:00
parent 963d0ac445
commit dade9ed2ac
2 changed files with 246 additions and 4 deletions

View file

@ -95,7 +95,7 @@
"Type":"UNKNOWN", "Type":"UNKNOWN",
"HotThreshold":[ "HotThreshold":[
"NAN", "NAN",
"NAN", "35.0",
"NAN", "NAN",
"NAN", "NAN",
"NAN", "NAN",
@ -111,7 +111,7 @@
"Type":"UNKNOWN", "Type":"UNKNOWN",
"HotThreshold":[ "HotThreshold":[
"NAN", "NAN",
"35.0", "NAN",
"NAN", "NAN",
"NAN", "NAN",
"NAN", "NAN",
@ -458,6 +458,123 @@
"PollingDelay":300000, "PollingDelay":300000,
"PassiveDelay":7000 "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", "Name":"LITTLE",
"Type":"CPU", "Type":"CPU",
@ -1249,6 +1366,10 @@
"Name":"wlc_fcc", "Name":"wlc_fcc",
"Type":"BATTERY" "Type":"BATTERY"
}, },
{
"Name":"usbc-port",
"Type":"BATTERY"
},
{ {
"Name":"tpu_cooling", "Name":"tpu_cooling",
"Type":"NPU", "Type":"NPU",

View file

@ -68,7 +68,7 @@
"Type":"UNKNOWN", "Type":"UNKNOWN",
"HotThreshold":[ "HotThreshold":[
"NAN", "NAN",
"NAN", "35.0",
"NAN", "NAN",
"NAN", "NAN",
"NAN", "NAN",
@ -84,7 +84,7 @@
"Type":"UNKNOWN", "Type":"UNKNOWN",
"HotThreshold":[ "HotThreshold":[
"NAN", "NAN",
"35.0", "NAN",
"NAN", "NAN",
"NAN", "NAN",
"NAN", "NAN",
@ -458,6 +458,123 @@
"PollingDelay":300000, "PollingDelay":300000,
"PassiveDelay":7000 "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", "Name":"LITTLE",
"Type":"CPU", "Type":"CPU",
@ -1249,6 +1366,10 @@
"Name":"wlc_fcc", "Name":"wlc_fcc",
"Type":"BATTERY" "Type":"BATTERY"
}, },
{
"Name":"usbc-port",
"Type":"BATTERY"
},
{ {
"Name":"tpu_cooling", "Name":"tpu_cooling",
"Type":"NPU", "Type":"NPU",