diff options
Diffstat (limited to 'common/i2c.c')
-rw-r--r-- | common/i2c.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/common/i2c.c b/common/i2c.c index fc6e657a18..af2aa61133 100644 --- a/common/i2c.c +++ b/common/i2c.c @@ -1030,3 +1030,23 @@ DECLARE_CONSOLE_COMMAND(i2ctest, command_i2ctest, "i2ctest count|udelay|dev", "I2C stress test"); #endif /* CONFIG_CMD_I2C_STRESS_TEST */ + +#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR +int i2c_get_protocol_info(struct host_cmd_handler_args *args) +{ + struct ec_response_get_protocol_info *r = args->response; + + memset(r, 0, sizeof(*r)); + r->protocol_versions = (1 << 3); + r->max_request_packet_size = I2C_MAX_HOST_PACKET_SIZE; + r->max_response_packet_size = I2C_MAX_HOST_PACKET_SIZE; + r->flags = 0; + + args->response_size = sizeof(*r); + + return EC_SUCCESS; +} +DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO, + i2c_get_protocol_info, + EC_VER_MASK(0)); +#endif /* CONFIG_HOSTCMD_I2C_SLAVE_ADDR */ |