diff options
-rw-r--r-- | include/ec_commands.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index b2abacb83a..c6c4c509dd 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1247,6 +1247,8 @@ enum ec_feature_code { EC_FEATURE_UNIFIED_WAKE_MASKS = 32, /* EC supports 64-bit host events */ EC_FEATURE_HOST_EVENT64 = 33, + /* EC supports CEC commands */ + EC_FEATURE_CEC = 35, }; #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) @@ -3157,6 +3159,9 @@ enum ec_mkbp_event { */ EC_MKBP_EVENT_HOST_EVENT64 = 7, + /* Notify the AP that something happened on CEC */ + EC_MKBP_EVENT_CEC = 8, + /* Number of MKBP events */ EC_MKBP_EVENT_COUNT, }; @@ -3181,6 +3186,9 @@ union __ec_align_offset1 ec_response_get_next_data { uint32_t fp_events; uint32_t sysrq; + + /* CEC events from enum mkbp_cec_event */ + uint32_t cec_events; }; struct __ec_align1 ec_response_get_next_event { @@ -3963,6 +3971,68 @@ struct __ec_align1 ec_response_i2c_passthru_protect { uint8_t status; /* Status flags (0: unlocked, 1: locked) */ }; + +/*****************************************************************************/ +/* + * HDMI CEC commands + * + * These commands are for sending and receiving message via HDMI CEC + */ + +#define MAX_CEC_MSG_LEN 16 + +/* CEC message from the AP to be written on the CEC bus */ +#define EC_CMD_CEC_WRITE_MSG 0x00B8 + +/* Message to write to the CEC bus */ +struct __ec_align1 ec_params_cec_write { + uint8_t msg[MAX_CEC_MSG_LEN]; +}; + +/* CEC message from a CEC sink reported back to the AP */ +#define EC_CMD_CEC_READ_MSG 0x00B9 + +/* Message read from to the CEC bus */ +struct __ec_align1 ec_response_cec_read { + uint8_t msg[MAX_CEC_MSG_LEN]; +}; + +/* Set various CEC parameters */ +#define EC_CMD_CEC_SET 0x00BA + +struct __ec_align1 ec_params_cec_set { + uint8_t cmd; /* enum cec_command */ + uint8_t val; +}; + +/* Read various CEC parameters */ +#define EC_CMD_CEC_GET 0x00BB + +struct __ec_align1 ec_params_cec_get { + uint8_t cmd; /* enum cec_command */ +}; + +struct __ec_align1 ec_response_cec_get { + uint8_t val; +}; + +enum cec_command { + /* CEC reading, writing and events enable */ + CEC_CMD_ENABLE, + /* CEC logical address */ + CEC_CMD_LOGICAL_ADDRESS, +}; + +/* Events from CEC to AP */ +enum mkbp_cec_event { + /* Outgoing message was acknowledged by a follower */ + EC_MKBP_CEC_SEND_OK = 1 << 0, + /* Outgoing message was not acknowledged */ + EC_MKBP_CEC_SEND_FAILED = 1 << 1, + /* Incoming message can be read out by AP */ + EC_MKBP_CEC_HAVE_DATA = 1 << 2, +}; + /*****************************************************************************/ /* System commands */ |