diff options
author | Scott Chao <scott_chao@wistron.corp-partner.google.com> | 2021-11-02 11:11:40 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-18 01:32:32 +0000 |
commit | 2ce0aba0fb6f4400ce3ef4479b7e885b2ab5fec9 (patch) | |
tree | c8908fcb1141b09b06025ba045eff8c96e5a0c0a /board/gimble/thermal.c | |
parent | 07de73c3113f35226eff345469336a50c83eb1f3 (diff) | |
download | chrome-ec-2ce0aba0fb6f4400ce3ef4479b7e885b2ab5fec9.tar.gz |
gimble: change fan table
Update thermal table for settings provided by thermal team on 2021-11-17.
This also add different fan speed on clamshell and tablet mode.
BUG=b:206733335, b:204155635
BRANCH=none
TEST=make -j BOARD=gimble
Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
Change-Id: I4be157945b56a248d4abd8260faad5e131f672cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256727
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'board/gimble/thermal.c')
-rw-r--r-- | board/gimble/thermal.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/board/gimble/thermal.c b/board/gimble/thermal.c index 101c436886..25e7bf2c00 100644 --- a/board/gimble/thermal.c +++ b/board/gimble/thermal.c @@ -9,6 +9,7 @@ #include "fan.h" #include "hooks.h" #include "host_command.h" +#include "tablet_mode.h" #include "temp_sensor.h" #include "thermal.h" #include "util.h" @@ -31,6 +32,8 @@ struct fan_step { int8_t off[TEMP_SENSOR_COUNT]; /* Fan rpm */ uint16_t rpm[FAN_CH_COUNT]; + /* Fan rpm for tablet mode */ + uint16_t rpm_tablet[FAN_CH_COUNT]; }; /* * TODO(b/167931578) Only monitor sensor3 for now. @@ -39,39 +42,45 @@ struct fan_step { static const struct fan_step fan_table[] = { { /* level 0 */ - .on = {44, -1, -1}, + .on = {43, -1, -1}, .off = {0, -1, -1}, .rpm = {0}, + .rpm_tablet = {0}, }, { /* level 1 */ - .on = {46, -1, -1}, - .off = {44, -1, -1}, - .rpm = {3200}, + .on = {45, -1, -1}, + .off = {43, -1, -1}, + .rpm = {3400}, + .rpm_tablet = {3400}, }, { /* level 2 */ - .on = {50, -1, -1}, - .off = {45, -1, -1}, - .rpm = {3600}, + .on = {46, -1, -1}, + .off = {44, -1, -1}, + .rpm = {3800}, + .rpm_tablet = {3700}, }, { /* level 3 */ - .on = {54, -1, -1}, - .off = {49, -1, -1}, - .rpm = {4100}, + .on = {48, -1, -1}, + .off = {45, -1, -1}, + .rpm = {4200}, + .rpm_tablet = {4100}, }, { /* level 4 */ - .on = {58, -1, -1}, - .off = {53, -1, -1}, - .rpm = {4900}, + .on = {50, -1, -1}, + .off = {47, -1, -1}, + .rpm = {4800}, + .rpm_tablet = {4800}, }, { /* level 5 */ - .on = {60, -1, -1}, - .off = {57, -1, -1}, - .rpm = {5200}, + .on = {52, -1, -1}, + .off = {49, -1, -1}, + .rpm = {5400}, + .rpm_tablet = {5200}, }, }; const int num_fan_levels = ARRAY_SIZE(fan_table); @@ -127,7 +136,10 @@ int fan_table_to_rpm(int fan, int *temp, enum temp_sensor_id temp_sensor) switch (fan) { case FAN_CH_0: - new_rpm = fan_table[current_level].rpm[FAN_CH_0]; + if (tablet_get_mode()) + new_rpm = fan_table[current_level].rpm_tablet[FAN_CH_0]; + else + new_rpm = fan_table[current_level].rpm[FAN_CH_0]; break; default: break; |