From d6048d1883617107ed0f428654ebec4d202d881c Mon Sep 17 00:00:00 2001 From: David Chao Date: Mon, 13 Mar 2023 16:20:03 +0800 Subject: [PATCH] thermal: seperate thermal config for charging - Separate thermal config for charger mode and remove the unused thermal throttling. Bug: 272701980 Test: charging throttling worked properly in charger. Change-Id: Ic8db468af99d11c24fb3ce074bad524ef1107bb9 --- device-husky.mk | 3 +- device-ripcurrent.mk | 3 +- device-shiba.mk | 3 +- thermal_info_config_charge_husky.json | 206 +++++++++++++++++++++ thermal_info_config_charge_ripcurrent.json | 19 ++ thermal_info_config_charge_shiba.json | 201 ++++++++++++++++++++ 6 files changed, 432 insertions(+), 3 deletions(-) create mode 100644 thermal_info_config_charge_husky.json create mode 100644 thermal_info_config_charge_ripcurrent.json create mode 100644 thermal_info_config_charge_shiba.json diff --git a/device-husky.mk b/device-husky.mk index f69c924..18907c5 100644 --- a/device-husky.mk +++ b/device-husky.mk @@ -80,7 +80,8 @@ DEVICE_MANIFEST_FILE += \ # Thermal Config PRODUCT_COPY_FILES += \ - device/google/shusky/thermal_info_config_husky.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json + device/google/shusky/thermal_info_config_husky.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ + device/google/shusky/thermal_info_config_charge_husky.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json # Power HAL config PRODUCT_COPY_FILES += \ diff --git a/device-ripcurrent.mk b/device-ripcurrent.mk index f3eabbf..3286cd0 100644 --- a/device-ripcurrent.mk +++ b/device-ripcurrent.mk @@ -79,7 +79,8 @@ DEVICE_MANIFEST_FILE += \ # Thermal Config PRODUCT_COPY_FILES += \ - device/google/shusky/thermal_info_config_ripcurrent.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json + device/google/shusky/thermal_info_config_ripcurrent.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ + device/google/shusky/thermal_info_config_charge_ripcurrent.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json # Power HAL config PRODUCT_COPY_FILES += \ diff --git a/device-shiba.mk b/device-shiba.mk index b56ea3f..d428a1c 100644 --- a/device-shiba.mk +++ b/device-shiba.mk @@ -78,7 +78,8 @@ DEVICE_MANIFEST_FILE += \ # Thermal Config PRODUCT_COPY_FILES += \ - device/google/shusky/thermal_info_config_shiba.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json + device/google/shusky/thermal_info_config_shiba.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json \ + device/google/shusky/thermal_info_config_charge_shiba.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_charge.json # Power HAL config PRODUCT_COPY_FILES += \ diff --git a/thermal_info_config_charge_husky.json b/thermal_info_config_charge_husky.json new file mode 100644 index 0000000..9ef043c --- /dev/null +++ b/thermal_info_config_charge_husky.json @@ -0,0 +1,206 @@ +{ + "Sensors":[ + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", 60.0], + "Multiplier":0.001 + }, + { + "Name":"neutral_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 43.4, "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/neutral_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"north_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 33.5, "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/north_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"charge_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 40.2, "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/charge_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"usb_pwr_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 35.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":"cam_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 33.4, "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/cam_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"disp_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 32.4, "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/disp_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"soc_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 52.7, "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/soc_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"quiet_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 37.7, "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/quiet_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE-SUB-0", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "battery", "neutral_therm", "quiet_therm", "usb_pwr_therm"], + "Coefficient":[0.17, 0.11, 0.11, 0.11, 0.13, 0.11, 0.11, 0.11, 0.21], + "Offset":-6920, + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE-SUB-1", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "battery", "neutral_therm", "quiet_therm", "usb_pwr_therm"], + "Coefficient":[0.58, 0.02, 0, 0.2, 0, 0, 0.03, 0.19, 0], + "Offset":-800, + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE", + "Type":"UNKNOWN", + "VirtualSensor":true, + "TriggerSensor":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "neutral_therm", "quiet_therm"], + "Formula":"MAXIMUM", + "Combination":["VIRTUAL-SKIN-CHARGE-SUB-0", "VIRTUAL-SKIN-CHARGE-SUB-1"], + "Coefficient":[1.0, 1.0], + "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": "chg_mdis", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 1, + "CdevCeiling": [0, 4, 7, 8, 9, 9, 9], + "LimitInfo": [0, 0, 0, 0, 0, 9, 9] + } + ] + } + ], + "CoolingDevices":[ + { + "Name":"chg_mdis", + "Type":"BATTERY" + }, + { + "Name":"usbc-port", + "Type":"BATTERY" + } + ], + "PowerRails":[ + { + "Name":"PPVAR_VSYS_PWR_DISP" + }, + { + "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"], + "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + "PowerSampleDelay":7000, + "PowerSampleCount":5 + } + ] +} diff --git a/thermal_info_config_charge_ripcurrent.json b/thermal_info_config_charge_ripcurrent.json new file mode 100644 index 0000000..4e7eecb --- /dev/null +++ b/thermal_info_config_charge_ripcurrent.json @@ -0,0 +1,19 @@ +{ + "Sensors":[ + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "60.0" + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + } + ] +} diff --git a/thermal_info_config_charge_shiba.json b/thermal_info_config_charge_shiba.json new file mode 100644 index 0000000..261fd72 --- /dev/null +++ b/thermal_info_config_charge_shiba.json @@ -0,0 +1,201 @@ +{ + "Sensors":[ + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", 60.0], + "Multiplier":0.001 + }, + { + "Name":"neutral_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 44.5, "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/neutral_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"north_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 35.5, "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/north_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"charge_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 41.0, "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/charge_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"usb_pwr_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 35.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":"cam_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 33.6, "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/cam_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"disp_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 32.6, "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/disp_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"soc_therm", + "Type":"UNKNOWN", + "HotThreshold":["NAN", 49.7, "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/soc_therm/tz_temp", + "Multiplier":0.001, + "PollingDelay":60000, + "PassiveDelay":7000 + }, + { + "Name":"quiet_therm", + "Type":"UNKNOWN", + "TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp" + }, + { + "Name":"VIRTUAL-SKIN-CHARGE-SUB-0", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "battery", "neutral_therm", "quiet_therm", "usb_pwr_therm"], + "Coefficient":[0.29, 0, 0, 0.27, 0.49, 0.01, 0.06, 0, 0.05], + "Offset":-6650, + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE-SUB-1", + "Type":"UNKNOWN", + "Hidden":true, + "VirtualSensor":true, + "Formula":"WEIGHTED_AVG", + "Combination":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "battery", "neutral_therm", "quiet_therm", "usb_pwr_therm"], + "Coefficient":[0.21, 0.02, 0, 0.25, 0, 0.22, 0, 0.17, 0.08], + "Offset":1710, + "Multiplier":0.001 + }, + { + "Name":"VIRTUAL-SKIN-CHARGE", + "Type":"UNKNOWN", + "VirtualSensor":true, + "TriggerSensor":["north_therm", "cam_therm", "soc_therm", "charge_therm", "disp_therm", "neutral_therm", "usb_pwr_therm"], + "Formula":"MAXIMUM", + "Combination":["VIRTUAL-SKIN-CHARGE-SUB-0", "VIRTUAL-SKIN-CHARGE-SUB-1"], + "Coefficient":[1.0, 1.0], + "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": "chg_mdis", + "CdevWeightForPID": [1, 1, 1, 1, 1, 1, 1], + "MaxReleaseStep": 1, + "MaxThrottleStep": 1, + "CdevCeiling": [0, 4, 7, 8, 9, 9, 9], + "LimitInfo": [0, 0, 0, 0, 0, 9, 9] + } + ] + } + ], + "CoolingDevices":[ + { + "Name":"chg_mdis", + "Type":"BATTERY" + }, + { + "Name":"usbc-port", + "Type":"BATTERY" + } + ], + "PowerRails":[ + { + "Name":"PPVAR_VSYS_PWR_DISP" + }, + { + "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"], + "Coefficient":[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + "PowerSampleDelay":7000, + "PowerSampleCount":5 + } + ] +}