diff options
author | Jameson Thies <jthies@google.com> | 2022-05-07 00:57:29 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-12 17:15:12 +0000 |
commit | 1453d97c26a41de6f34fb8597ade4a2d240bf9cb (patch) | |
tree | 9b123b87fc3e26f9149c4478de4b9518a69ff472 /include | |
parent | 086b0b4d602dad8b84d5b37521d2887fd71af9c4 (diff) | |
download | chrome-ec-1453d97c26a41de6f34fb8597ade4a2d240bf9cb.tar.gz |
TCPMV2: Send Alert Message on Power State Change
Some docks will have lights which are meant to reflect the current power
state of a Chromebook. This CL is to send an Alert message to partners
when power state changes. If the power state is important to the
partner, they can then request more information with a Get_Status
command.
BUG=b:226228461
TEST=Changed power state of device and observed Alert message in EC log.
BRANCH=None
Signed-off-by: Jameson Thies <jthies@google.com>
Change-Id: If46c0e3b40d0a17c9b746c4efa480696a6293e9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3632821
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index cc6ee376cf..12e34520bc 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1252,16 +1252,26 @@ enum pd_ext_msg_type { /* 31 Reserved */ }; +/* Alert Data Object fields for REV 3.1 */ +#define ADO_EXTENDED_ALERT_EVENT (BIT(24) << 7) /* Alert Data Object fields for REV 3.0 */ -#define ADO_OVP_EVENT BIT(30) -#define ADO_SOURCE_INPUT_CHANGE BIT(29) -#define ADO_OPERATING_CONDITION_CHANGE BIT(28) -#define ADO_OTP_EVENT BIT(27) -#define ADO_OCP_EVENT BIT(26) -#define ADO_BATTERY_STATUS_CHANGE BIT(25) +#define ADO_OVP_EVENT (BIT(24) << 6) +#define ADO_SOURCE_INPUT_CHANGE (BIT(24) << 5) +#define ADO_OPERATING_CONDITION_CHANGE (BIT(24) << 4) +#define ADO_OTP_EVENT (BIT(24) << 3) +#define ADO_OCP_EVENT (BIT(24) << 2) +#define ADO_BATTERY_STATUS_CHANGE (BIT(24) << 1) #define ADO_FIXED_BATTERIES(n) ((n & 0xf) << 20) #define ADO_HOT_SWAPPABLE_BATTERIES(n) ((n & 0xf) << 16) +/* Extended alert event types for REV 3.1 */ +enum ado_extended_alert_event_type { + ADO_POWER_STATE_CHANGE = 0x1, + ADO_POWER_BUTTON_PRESS = 0x2, + ADO_POWER_BUTTON_RELEASE = 0x3, + ADO_CONTROLLER_INITIATED_WAKE = 0x4, +}; + /* Data message type */ enum pd_data_msg_type { /* 0 Reserved */ |