summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/usb_common.h10
-rw-r--r--include/usb_pd.h10
-rw-r--r--include/usb_pe_sm.h1
3 files changed, 21 insertions, 0 deletions
diff --git a/include/usb_common.h b/include/usb_common.h
index 078f4b0029..180ebbcc95 100644
--- a/include/usb_common.h
+++ b/include/usb_common.h
@@ -179,4 +179,14 @@ int pd_get_saved_port_flags(int port, uint8_t *flags);
* @param do_set value written to the BB Ram flag
*/
void pd_update_saved_port_flags(int port, uint8_t flag, uint8_t do_set);
+
+/**
+ * Build PD alert message
+ *
+ * @param msg pointer where message is stored
+ * @param len pointer where length of message is stored in bytes
+ * @param pr current PD power role
+ * @return EC_SUCCESS on success else EC_ERROR_INVAL
+ */
+int pd_build_alert_msg(uint32_t *msg, uint32_t *len, enum pd_power_role pr);
#endif /* __CROS_EC_USB_COMMON_H */
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 90d8a1392a..09468911bf 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -1096,6 +1096,16 @@ enum pd_ext_msg_type {
/* 15-31 Reserved */
};
+/* 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_FIXED_BATTERIES(n) ((n & 0xf) << 20)
+#define ADO_HOT_SWAPPABLE_BATTERIES(n) ((n & 0xf) << 16)
+
/* Data message type */
enum pd_data_msg_type {
/* 0 Reserved */
diff --git a/include/usb_pe_sm.h b/include/usb_pe_sm.h
index e69eff572f..8089fddb55 100644
--- a/include/usb_pe_sm.h
+++ b/include/usb_pe_sm.h
@@ -42,6 +42,7 @@ enum pe_dpm_request {
DPM_REQUEST_HARD_RESET_SEND = BIT(15),
DPM_REQUEST_SOFT_RESET_SEND = BIT(16),
DPM_REQUEST_PORT_DISCOVERY = BIT(17),
+ DPM_REQUEST_SEND_ALERT = BIT(18),
};
/**