From 02bc91305c921ae2aa532e57385c0b90af65bc3e Mon Sep 17 00:00:00 2001 From: David Chao Date: Fri, 19 Aug 2022 15:30:09 +0800 Subject: [PATCH] thermal: seperate thermal config for charging - Separate thermal config for charger mode and remove the unused thermal throttling. Bug: 240897207 Test: usbc overheating protection and charging throttling worked properly in charger. Change-Id: Ib970c16c0ed08b52fb2c9387b71cb2211f4bc1f3 --- device-lynx.mk | 3 +- thermal_info_config_charge_lynx.json | 290 +++++++++++++++++++++++++++ 2 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 thermal_info_config_charge_lynx.json diff --git a/device-lynx.mk b/device-lynx.mk index f97b4dc..4381b62 100644 --- a/device-lynx.mk +++ b/device-lynx.mk @@ -87,7 +87,8 @@ DEVICE_MANIFEST_FILE += \ # Thermal Config PRODUCT_COPY_FILES += \ - device/google/lynx/thermal_info_config_lynx.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json + device/google/lynx/thermal_info_config_lynx.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ + device/google/lynx/thermal_info_config_charge_lynx.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json # Power HAL config PRODUCT_COPY_FILES += \ diff --git a/thermal_info_config_charge_lynx.json b/thermal_info_config_charge_lynx.json new file mode 100644 index 0000000..20f6fd2 --- /dev/null +++ b/thermal_info_config_charge_lynx.json @@ -0,0 +1,290 @@ +{ + "Sensors":[ + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", 60.0], + "Multiplier":0.001 + }, + { + "Name":"neutral_therm", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"gnss_tcxo_therm", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"usb_pwr_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"], + "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"usb_pwr_therm2", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"skin_therm1", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 29.9, "NAN", "NAN", "NAN", "NAN", "NAN"], + "HotHysteresis":[0.0, 0.9, 0.0, 0.0, 0.0, 0.0, 0.0], + "TempPath":"/dev/thermal/tz-by-name/skin_therm1/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"skin_therm2", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/skin_therm2/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"disp_therm", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/disp_therm/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"quiet_therm", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp", + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-NEU-QUT-DISP-SKIN1-GNSS-BATT", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["neutral_therm", "quiet_therm", "disp_therm", "skin_therm1", "gnss_tcxo_therm", "battery"], + "Coefficient":[0.1, 0.4, 0.15, 0.1, 0.1, 0.15], + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-NEU-DISP-SKIN1-GNSS-BATT", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["neutral_therm", "disp_therm", "skin_therm1", "gnss_tcxo_therm", "battery"], + "Coefficient":[0.2, 0.26, 0.1, 0.19, 0.25], + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN2-USB2-DISP-BATT", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["skin_therm2", "usb_pwr_therm2", "disp_therm", "battery"], + "Coefficient":[0.28, 0.21, 0.3, 0.21], + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-QUT-SKIN2-USB2-DISP", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["quiet_therm", "skin_therm2", "usb_pwr_therm2", "disp_therm"], + "Coefficient":[0.35, 0.25, 0.2, 0.2], + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "TriggerSensor":"skin_therm1", + "Formula":"MAXIMUM", + "Combination":["VIRTUAL-NEU-QUT-DISP-SKIN1-GNSS-BATT", "VIRTUAL-NEU-DISP-SKIN1-GNSS-BATT", "VIRTUAL-SKIN2-USB2-DISP-BATT", "VIRTUAL-QUT-SKIN2-USB2-DISP"], + "Coefficient":[1.0, 1.0, 1.0, 1.0], + "HotThreshold":["NAN", 35.0, 39.0, 43.0, 45.0, 47.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9], + "Multiplier":0.001, + "PollingDelay":300000, + "PassiveDelay":7000, + "PIDInfo": { + "K_Po":["NAN", "NAN", 700, "NAN", "NAN", "NAN", "NAN"], + "K_Pu":["NAN", "NAN", 700, "NAN", "NAN", "NAN", "NAN"], + "K_I":["NAN", "NAN", 5, "NAN", "NAN", "NAN", "NAN"], + "K_D":["NAN", "NAN", 0, "NAN", "NAN", "NAN", "NAN"], + "I_Max":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "S_Power":["NAN", "NAN", 1500, "NAN", "NAN", "NAN", "NAN"], + "MinAllocPower":["NAN", "NAN", 300, "NAN", "NAN", "NAN", "NAN"], + "MaxAllocPower":["NAN", "NAN", 6000, "NAN", "NAN", "NAN", "NAN"], + "I_Cutoff":["NAN", "NAN", 2, "NAN", "NAN", "NAN", "NAN"] + }, + "ExcludedPowerInfo": [ + { + "PowerRail": "PARTIAL_SYSTEM_POWER", + "PowerWeight": [0.5, 0.5, 0.8, 1.0, 1.0, 1.0, 1.0] + } + ], + "BindedCdevInfo": [ + { + "CdevRequest": "fcc", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 1, + "CdevCeiling": [0, 9, 10, 11, 12, 12, 12], + "LimitInfo": [0, 0, 0, 0, 0, 12, 12] + } + ] + }, + { + "Name":"VIRTUAL-SKIN-CHARGE-WLC", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "TriggerSensor":"skin_therm1", + "Formula":"WEIGHTED_AVG", + "Combination":["skin_therm2", "usb_pwr_therm2", "disp_therm"], + "Coefficient":[0.51, 0.25, 0.24], + "HotThreshold":["NAN", 39.0, 41.0, 43.0, 45.0, 47.0, 55.0], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 1.9, 1.9], + "Multiplier":0.001, + "PollingDelay":300000, + "PassiveDelay":7000, + "PIDInfo": { + "K_Po":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "K_Pu":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "K_I":["NAN", "NAN", 5, "NAN", "NAN", "NAN", "NAN"], + "K_D":["NAN", "NAN", 0, "NAN", "NAN", "NAN", "NAN"], + "I_Max":["NAN", "NAN", 800, "NAN", "NAN", "NAN", "NAN"], + "S_Power":["NAN", "NAN", 3600, "NAN", "NAN", "NAN", "NAN"], + "MinAllocPower":["NAN", "NAN", 300, "NAN", "NAN", "NAN", "NAN"], + "MaxAllocPower":["NAN", "NAN", 6000, "NAN", "NAN", "NAN", "NAN"], + "I_Cutoff":["NAN", "NAN", 2, "NAN", "NAN", "NAN", "NAN"] + }, + "ExcludedPowerInfo": [ + { + "PowerRail": "PARTIAL_SYSTEM_POWER", + "PowerWeight": [0.5, 0.5, 0.8, 1.0, 1.0, 1.0, 1.0] + } + ], + "BindedCdevInfo": [ + { + "CdevRequest": "dc_icl", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 1, + "CdevCeiling": [0, 5, 10, 11, 12, 12, 12], + "LimitInfo": [0, 0, 0, 0, 0, 12, 12] + } + ] + }, + { + "Name":"USB-MINUS-SKIN2", + "Type":"UNKNOWN", + "VirtualSensor":true, + "TriggerSensor": "usb_pwr_therm", + "Formula":"WEIGHTED_AVG", + "Combination":["usb_pwr_therm", "skin_therm2"], + "Coefficient":[1.0, -1.0], + "HotThreshold":["NAN", "7.0", "NAN", "NAN", "NAN", "NAN", "NAN"], + "BindedCdevInfo": [ + { + "CdevRequest": "usbc-port", + "LimitInfo": [0, 0, 0, 0, 0, 0, 0] + } + ], + "Multiplier":0.001, + "PollingDelay":0, + "PassiveDelay":7000 + }, + { + "Name":"VIRTUAL-USB-THROTTLING", + "Type":"USB_PORT", + "Version":"0.1", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "TriggerSensor": "usb_pwr_therm", + "Combination":["usb_pwr_therm", "USB-MINUS-SKIN2"], + "Coefficient":[40000, 10000], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "2.0", "NAN", "NAN"], + "BindedCdevInfo": [ + { + "CdevRequest": "usbc-port", + "LimitInfo": [0, 0, 0, 0, 1, 1, 1] + } + ], + "VrThreshold":"NAN", + "Multiplier":1, + "PollingDelay":60000, + "PassiveDelay":7000 + } + ], + "CoolingDevices":[ + { + "Name":"fcc", + "Type":"BATTERY" + }, + { + "Name":"dc_icl", + "Type":"BATTERY" + }, + { + "Name":"usbc-port", + "Type":"BATTERY" + } + ], + "PowerRails":[ + { + "Name":"VSYS_PWR_WLAN_BT" + }, + { + "Name":"VSYS_PWR_DISPLAY" + }, + { + "Name":"VSYS_PWR_MODEM" + }, + { + "Name":"S2M_VDD_CPUCL2", + "PowerSampleDelay":7000, + "PowerSampleCount":1 + + }, + { + "Name":"S3M_VDD_CPUCL1", + "PowerSampleDelay":7000, + "PowerSampleCount":1 + }, + { + "Name":"S4M_VDD_CPUCL0", + "PowerSampleDelay":7000, + "PowerSampleCount":1 + }, + { + "Name":"S5M_VDD_INT" + }, + { + "Name":"S1M_VDD_MIF" + }, + { + "Name":"S2S_VDD_G3D", + "PowerSampleDelay":7000, + "PowerSampleCount":1 + }, + { + "Name":"PARTIAL_SYSTEM_POWER", + "VirtualRails":true, + "Formula":"WEIGHTED_AVG", + "Combination":["VSYS_PWR_MODEM", "S2M_VDD_CPUCL2", "S3M_VDD_CPUCL1", "S4M_VDD_CPUCL0", "S5M_VDD_INT", "S1M_VDD_MIF", "S2S_VDD_G3D", "VSYS_PWR_WLAN_BT", "VSYS_PWR_DISPLAY"], + "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + "PowerSampleDelay":14000, + "PowerSampleCount":5 + } + ] +}