diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2023-02-21 08:59:19 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-21 18:29:30 +0000 |
commit | 9361e9f12e4266d4536d0baba438d6b2ace77cb9 (patch) | |
tree | 2f8382d12bf8ad4cb983cdd35c47f970411bd751 | |
parent | e3c57eec7e9ca7c20a985e0f75caf9b4ec45b40e (diff) | |
download | chrome-ec-9361e9f12e4266d4536d0baba438d6b2ace77cb9.tar.gz |
Fan: print 'stalled' for rpm == 0xfffe
This patch makes 'ectool pwmgetfanrpm' print 'stalled' in case the EC
returns 0xfffe. This value used to be used for the EC to indicate a
stalled fan but has been deprecated. ectool needs to continue to support
old ECs.
BUG=b:269241655
BRANCH=None
TEST=buildall
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I252f35880859847b524857b6c2c44adb4b118b88
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4275601
Commit-Queue: Diana Z <dzigterman@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | include/ec_commands.h | 4 | ||||
-rw-r--r-- | util/ectool.cc | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 8c3f3c442e..87985175a5 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -252,7 +252,9 @@ extern "C" { /* Report 0 for fan stalled so userspace applications can take * an appropriate action based on this value to control the fan. */ -#define EC_FAN_SPEED_STALLED 0x0 /* Fan stalled */ +#define EC_FAN_SPEED_STALLED 0x0 +/* This should be used only for ectool to support old ECs. */ +#define EC_FAN_SPEED_STALLED_DEPRECATED 0xfffe /* Battery bit flags at EC_MEMMAP_BATT_FLAG. */ #define EC_BATT_FLAG_AC_PRESENT 0x01 diff --git a/util/ectool.cc b/util/ectool.cc index f0da13dd51..86c4210fba 100644 --- a/util/ectool.cc +++ b/util/ectool.cc @@ -3649,6 +3649,9 @@ static int print_fan(int idx) switch (rv) { case EC_FAN_SPEED_NOT_PRESENT: return -1; + case EC_FAN_SPEED_STALLED_DEPRECATED: + printf("Fan %d stalled (RPM: %d)\n", idx, rv); + break; default: printf("Fan %d RPM: %d\n", idx, rv); break; |