media: cros-ec-cec: Get number of CEC ports from EC

Add a new CEC port count host command and use it to query the number of
CEC ports from the EC. If the host command is not supported then it must
be old EC firmware which only supports one port, so fall back to
assuming one port.

This patch completes support for multiple ports in cros-ec-cec.

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:44:01 +10:00
committed by Hans Verkuil
parent e7885b9c65
commit 5d227f02ce
2 changed files with 46 additions and 5 deletions

View File

@@ -4536,6 +4536,17 @@ struct ec_response_cec_get {
uint8_t val;
} __ec_align1;
/* Get the number of CEC ports */
#define EC_CMD_CEC_PORT_COUNT 0x00C1
/**
* struct ec_response_cec_port_count - CEC port count response
* @port_count: number of CEC ports
*/
struct ec_response_cec_port_count {
uint8_t port_count;
} __ec_align1;
/* CEC parameters command */
enum cec_command {
/* CEC reading, writing and events enable */