summaryrefslogtreecommitdiff
path: root/thermalConfig.cpp
diff options
context:
space:
mode:
authorMinghao Zhang <quic_minghao@quicinc.com>2022-08-25 22:26:31 +0800
committerchrisl7 <wandersonrodriguesf1@gmail.com>2023-02-25 16:41:36 -0800
commit2225ef8d165924fdb7f0437d4ef9143e2fbebb42 (patch)
tree995feb3d9b07986bbb4405b9554919d34211ec43 /thermalConfig.cpp
parent4097b0bdbb09ba61c4856dabb18d4764315d80a4 (diff)
thermal-hal: Update thermal HAL 2.0 configs for SA8150P
1. Add a new map battery_bcl_cfg_disable_map to distinguish target socs need not battery and bcl config. 2. Update thermal HAL 2.0 configs for SA8150P. Change-Id: I086fcb5ee44c98e71e946f5d0bd164888f345a22 Signed-off-by: chrisl7 <wandersonrodriguesf1@gmail.com>
Diffstat (limited to 'thermalConfig.cpp')
-rw-r--r--thermalConfig.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/thermalConfig.cpp b/thermalConfig.cpp
index 0ebc4f4..4b4c10d 100644
--- a/thermalConfig.cpp
+++ b/thermalConfig.cpp
@@ -622,7 +622,7 @@ namespace implementation {
"cpu-1-3-usr",
};
- std::vector<struct target_therm_cfg> sensor_cfg_msmnile = {
+ std::vector<struct target_therm_cfg> sensor_cfg_msmnile_common = {
{
TemperatureType::CPU,
cpu_sensors_kona,
@@ -659,6 +659,9 @@ namespace implementation {
40000,
true,
},
+ };
+
+ std::vector<struct target_therm_cfg> sensor_cfg_msmnile_specific = {
{
TemperatureType::BCL_CURRENT,
{ "pm8150b-ibat-lvl0" },
@@ -1254,10 +1257,10 @@ namespace implementation {
{435, sensor_cfg_lito},
{459, sensor_cfg_lito},
{476, sensor_cfg_lito}, // orchid
- {339, sensor_cfg_msmnile},
- {361, sensor_cfg_msmnile},
- {362, sensor_cfg_msmnile},
- {367, sensor_cfg_msmnile},
+ {339, sensor_cfg_msmnile_common},
+ {361, sensor_cfg_msmnile_common},
+ {362, sensor_cfg_msmnile_common},
+ {367, sensor_cfg_msmnile_common},
{356, kona_common}, // kona
{415, lahaina_common}, // lahaina
{439, lahaina_common}, // lahainap
@@ -1285,6 +1288,9 @@ namespace implementation {
const std::unordered_map<int, std::vector<struct target_therm_cfg>>
msm_soc_specific = {
+ {339, sensor_cfg_msmnile_specific},
+ {361, sensor_cfg_msmnile_specific},
+ {362, sensor_cfg_msmnile_specific},
{356, kona_specific}, // kona
{415, lahaina_specific}, // lahaina
{439, lahaina_specific}, // lahainap
@@ -1305,6 +1311,11 @@ namespace implementation {
{601, kalama_specific}, //Kalamap_sg
};
+ const std::unordered_map<int, bool>
+ battery_bcl_cfg_disable_map = {
+ {367, true},
+ };
+
std::vector<struct target_therm_cfg> add_target_config(
int socID,
std::vector<struct target_therm_cfg> conf)
@@ -1323,6 +1334,7 @@ namespace implementation {
ThermalConfig::ThermalConfig():cmnInst()
{
std::unordered_map<int, std::vector<struct target_therm_cfg>>::const_iterator it;
+ std::unordered_map<int, bool>::const_iterator it_2;
std::vector<struct target_therm_cfg>::iterator it_vec;
bool bcl_defined = false;
std::string soc_val;
@@ -1360,10 +1372,13 @@ namespace implementation {
bcl_defined = true;
}
- thermalConfig.push_back(bat_conf);
- if (!bcl_defined)
- thermalConfig.insert(thermalConfig.end(),
- bcl_conf.begin(), bcl_conf.end());
+ it_2 = battery_bcl_cfg_disable_map.find(soc_id);
+ if (it_2 == battery_bcl_cfg_disable_map.end() || !it_2->second) {
+ thermalConfig.push_back(bat_conf);
+ if (!bcl_defined)
+ thermalConfig.insert(thermalConfig.end(),
+ bcl_conf.begin(), bcl_conf.end());
+ }
LOG(DEBUG) << "Total sensors:" << thermalConfig.size();
}
} // namespace implementation