From f48cf0e8b27fb484271540e4cc272aea581a3b48 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Fri, 20 Oct 2017 10:08:12 +0800 Subject: Fizz: Modify thermal table Modify thermal table for Fizz reference patches: 627542, 288256, 329359 on off RPM step0 0 step1 16 2 2800 step2 27 18 3200 step3 35 29 3400 step4 43 37 4200 step5 54 45 4800 step6 64 56 5200 step7 97 83 5600 Prochot degree: active when t >= 88C release when t <= 85C Shutdown degree: when t >= 90C BUG=b:67487721, b:64439568 BRANCH=master TEST=fan target speed follows table, make -j buildall pass Change-Id: I3378668a560b8ddc568fe9cbf2703613fad8e4b6 Signed-off-by: Ryan Zhang Reviewed-on: https://chromium-review.googlesource.com/729606 Reviewed-by: Daisuke Nojiri --- common/fan.c | 4 ++++ common/thermal.c | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/fan.c b/common/fan.c index 18ea31acdb..5e2f85475f 100644 --- a/common/fan.c +++ b/common/fan.c @@ -510,7 +510,11 @@ static void pwm_fan_resume(void) { int fan; for (fan = 0; fan < CONFIG_FANS; fan++) { +#ifdef CONFIG_FAN_RPM_CUSTOM + set_thermal_control_enabled(fan, 1); +#else set_thermal_control_enabled(fan, 0); +#endif fan_set_rpm_target(fans[fan].ch, fans[fan].rpm_max); set_enabled(fan, 1); } diff --git a/common/thermal.c b/common/thermal.c index bd9ed7fbf0..7d7438f3e5 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -80,12 +80,17 @@ static void thermal_control(void) /* check all the limits */ for (j = 0; j < EC_TEMP_THRESH_COUNT; j++) { int limit = thermal_params[i].temp_host[j]; + int release = thermal_params[i].temp_host_release[j]; if (limit) { num_valid_limits[j]++; - if (t > limit) + if (t > limit) { count_over[j]++; - else if (t < limit) + } else if (release) { + if (t < release) + count_under[j]++; + } else if (t < limit) { count_under[j]++; + } } } @@ -130,7 +135,6 @@ static void thermal_control(void) cond_set_false(&cond_hot[j]); } - /* What do we do about it? (note hard-coded logic). */ if (cond_went_true(&cond_hot[EC_TEMP_THRESH_HALT])) { -- cgit v1.2.1