summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2021-09-21 16:27:52 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-01 22:24:59 +0000
commit4d5a9a823e3eef6d624b326cbbafebc698d71cdc (patch)
tree1a4eec2c902e5bb6effb4168372a663c06bf882d
parent066a846f76f8fd03408de6fd86e1d8270d4a1475 (diff)
downloadchrome-ec-4d5a9a823e3eef6d624b326cbbafebc698d71cdc.tar.gz
hostcmd: Define I2C speed control interface
This defines an host command to get or set the I2C bus speed of an I2C bus located on the EC. BRANCH=none BUG=b:201039003 TEST=with follow-on patches, switched I2C bus speed between 400 kHz and 1 MHz using ectool. Cq-Depend: chromium:3181506 Change-Id: I57889ebf40bcec397b6f9a52822bb5479702e9e4 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181505 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
-rw-r--r--include/ec_commands.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index d866f90918..e317c29e28 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -7010,6 +7010,31 @@ enum ec_set_base_state_cmd {
EC_SET_BASE_STATE_RESET,
};
+#define EC_CMD_I2C_CONTROL 0x0139
+
+/* Subcommands for I2C control */
+
+enum ec_i2c_control_command {
+ EC_I2C_CONTROL_GET_SPEED,
+ EC_I2C_CONTROL_SET_SPEED,
+};
+
+#define EC_I2C_CONTROL_SPEED_UNKNOWN 0
+
+struct ec_params_i2c_control {
+ uint8_t port; /* I2C port number */
+ uint8_t cmd; /* enum ec_i2c_control_command */
+ union {
+ uint16_t speed_khz;
+ } cmd_params;
+} __ec_align_size1;
+
+struct ec_response_i2c_control {
+ union {
+ uint16_t speed_khz;
+ } cmd_response;
+} __ec_align_size1;
+
/*****************************************************************************/
/* The command range 0x200-0x2FF is reserved for Rotor. */