cros_ec: Show events in human-readable form

Add a command to show the current events as a list of names. This is
easier to decipher than a bit mask.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-01-16 14:52:29 -07:00
parent 3a6c994f38
commit 3ae338299e
3 changed files with 112 additions and 7 deletions

View File

@@ -364,10 +364,20 @@ static int process_cmd(struct ec_state *ec,
resp->mask |= EC_HOST_EVENT_MASK(
EC_HOST_EVENT_KEYBOARD_RECOVERY);
}
if (ec->test_flags & CROSECT_LID_OPEN)
resp->mask |=
EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN);
len = sizeof(*resp);
break;
}
case EC_CMD_HOST_EVENT_CLEAR_B: {
const struct ec_params_host_event_mask *req = req_data;
if (req->mask & EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN))
ec->test_flags &= ~CROSECT_LID_OPEN;
len = 0;
break;
}
case EC_CMD_VBOOT_HASH: {
const struct ec_params_vboot_hash *req = req_data;
struct ec_response_vboot_hash *resp = resp_data;