diff options
author | Reka Norman <rekanorman@chromium.org> | 2023-08-25 12:43:58 +1000 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-27 09:39:54 +0200 |
commit | 1cabf52639d16428bc0d61028dcaf38e29c5f3b5 (patch) | |
tree | 88108f5b22d117e7a1f67bdfa85d7ae854ae0dd4 /include | |
parent | adbfc747ddfb48c06d238640e16939916b7a4494 (diff) | |
download | linux-stable-1cabf52639d16428bc0d61028dcaf38e29c5f3b5.tar.gz linux-stable-1cabf52639d16428bc0d61028dcaf38e29c5f3b5.tar.bz2 linux-stable-1cabf52639d16428bc0d61028dcaf38e29c5f3b5.zip |
media: cros-ec-cec: Support multiple ports in MKBP cec_events
Use the top four bits of the cec_events MKBP event to store the port
number.
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/platform_data/cros_ec_commands.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index 9a0c6e28f370..b7e8573a8a49 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -4440,6 +4440,16 @@ struct ec_response_i2c_passthru_protect { #define MAX_CEC_MSG_LEN 16 +/* + * Helper macros for packing/unpacking cec_events. + * bits[27:0] : bitmask of events from enum mkbp_cec_event + * bits[31:28]: port number + */ +#define EC_MKBP_EVENT_CEC_PACK(events, port) \ + (((events) & GENMASK(27, 0)) | (((port) & 0xf) << 28)) +#define EC_MKBP_EVENT_CEC_GET_EVENTS(event) ((event) & GENMASK(27, 0)) +#define EC_MKBP_EVENT_CEC_GET_PORT(event) (((event) >> 28) & 0xf) + /* CEC message from the AP to be written on the CEC bus */ #define EC_CMD_CEC_WRITE_MSG 0x00B8 |