summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2021-03-09 14:17:05 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-15 02:20:20 +0000
commitd4f7c9688c9669088b8ae13c2ada2e50f2bc888a (patch)
tree6d380b03f1fe8a43685ce9f52426c398570a457d
parent6ce7af6e3a7e6e2aa801002dd389489dd0d86561 (diff)
downloadchrome-ec-d4f7c9688c9669088b8ae13c2ada2e50f2bc888a.tar.gz
dirinboz: update thermal protect parameter
This patch update thermal protect parameter as below: All trigger/release by charger thermistor, Charging current 0.5A: Trigger > 58’C ; Release < 57’C CPU PROCHOT: Trigger > 63’C ; Release < 62’C Set USB-C0 port to 1.5A: Trigger > 63’C ; Release < 62’C BUG=b:181803301 BRANCH=zork TEST=verify EC behavior intended when trigger/ release thermal protection. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I9ce794a37c2d29f02f1e2829dcc53340c542b13e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751304 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
-rw-r--r--board/dirinboz/board.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/board/dirinboz/board.c b/board/dirinboz/board.c
index 45006ec40e..f9630875b6 100644
--- a/board/dirinboz/board.c
+++ b/board/dirinboz/board.c
@@ -546,6 +546,7 @@ int charger_profile_override(struct charge_state_data *curr)
static int limit_charge;
static int limit_usbc_power;
static int limit_usbc_power_backup;
+ enum tcpc_rp_value rp;
if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
return 0;
@@ -553,18 +554,20 @@ int charger_profile_override(struct charge_state_data *curr)
temp_sensor_read(TEMP_SENSOR_CHARGER, &thermal_sensor_temp);
if (thermal_sensor_temp > prev_thermal_sensor_temp) {
- if (thermal_sensor_temp > C_TO_K(56)) {
+ if (thermal_sensor_temp > C_TO_K(63))
+ limit_usbc_power = 1;
+
+ if (thermal_sensor_temp > C_TO_K(58)) {
if (curr->state == ST_CHARGE)
limit_charge = 1;
-
- limit_usbc_power = 1;
}
} else if (thermal_sensor_temp < prev_thermal_sensor_temp) {
- if (thermal_sensor_temp < C_TO_K(53)) {
+ if (thermal_sensor_temp < C_TO_K(62))
+ limit_usbc_power = 0;
+
+ if (thermal_sensor_temp < C_TO_K(57)) {
if (curr->state == ST_CHARGE)
limit_charge = 0;
-
- limit_usbc_power = 0;
}
}
@@ -575,10 +578,13 @@ int charger_profile_override(struct charge_state_data *curr)
if (limit_usbc_power != limit_usbc_power_backup) {
if (limit_usbc_power == 1)
- typec_select_src_current_limit_rp(0, TYPEC_RP_1A5);
+ rp = TYPEC_RP_1A5;
else
- typec_select_src_current_limit_rp(0, TYPEC_RP_3A0);
+ rp = TYPEC_RP_3A0;
+ ppc_set_vbus_source_current_limit(0, rp);
+ tcpm_select_rp_value(0, rp);
+ pd_update_contract(0);
limit_usbc_power_backup = limit_usbc_power;
}
@@ -602,11 +608,11 @@ enum ec_status charger_profile_override_set_param(uint32_t param,
__override struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = {
[TEMP_SENSOR_CHARGER] = {
.temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(56),
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(63),
[EC_TEMP_THRESH_HALT] = C_TO_K(92),
},
.temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(53),
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(62),
}
},
[TEMP_SENSOR_SOC] = {