media: cros-ec-cec: Support multiple ports in write command

Add a v1 of the CEC write command which contains a port parameter. Check
which versions of the write command the EC supports and use the highest
supported version. If it only supports v0, check that there is only one
port. With v0, the EC will assume all write commands are for port 0.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Reka Norman
2023-08-25 12:43:57 +10:00
committed by Hans Verkuil
parent e90bd1fe7c
commit adbfc747dd
2 changed files with 63 additions and 3 deletions
@@ -4451,6 +4451,18 @@ struct ec_params_cec_write {
uint8_t msg[MAX_CEC_MSG_LEN];
} __ec_align1;
/**
* struct ec_params_cec_write_v1 - Message to write to the CEC bus
* @port: CEC port to write the message on
* @msg_len: length of msg in bytes
* @msg: message content to write to the CEC bus
*/
struct ec_params_cec_write_v1 {
uint8_t port;
uint8_t msg_len;
uint8_t msg[MAX_CEC_MSG_LEN];
} __ec_align1;
/* Set various CEC parameters */
#define EC_CMD_CEC_SET 0x00BA