diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2021-11-05 13:51:13 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-09 17:58:53 +0000 |
commit | ea1eee5cc83c63d7ff8d3aa36f777c54e7d40ac2 (patch) | |
tree | c2f7ae152ac622df2ea9930bafcac05d5bd7039f | |
parent | 4433b13348b354f1eca560fdbcb3c97257a36865 (diff) | |
download | chrome-ec-ea1eee5cc83c63d7ff8d3aa36f777c54e7d40ac2.tar.gz |
zephyr: i2c: add config to enable I2C_CONTROL HC
Add config to enable handling the I2C_CONTROL host command to set/get
i2c speed. To change the speed use dynamic-speed flag in dts and define
remote-port.
BUG=b:201408931
TEST=zmake testall & get and set i2c freq via ectool e.g.
ectool i2cspeed 0 (400)
BRANCH=main
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ib0d00471debeb79e50ccb7a7aafa795ce0a84849
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3264186
Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/Kconfig | 11 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig index e80a10d476..d08b93b2ff 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -500,6 +500,17 @@ config PLATFORM_EC_CONSOLE_CMD_I2C_SPEED the DYNAMIC_SPEED port flag set, the speed can be set. In all cases, the bus speed is in units of kHz. +config PLATFORM_EC_HOSTCMD_I2C_CONTROL + bool "Host command: i2c_control" + default n + depends on PLATFORM_EC_I2C + help + Enable the I2C_CONTROL host command. This comamnd is used to + display an I2C port's bus speed. Additionally, for ports with + the DYNAMIC_SPEED port flag set, the speed can be set. In all + cases, the bus speed is in units of kHz. More functionality of + the command may be added in the future. + config PLATFORM_EC_SMBUS_PEC bool "Packet error checking support for SMBus" help diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 63f1ed6cdf..735beffc52 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -187,6 +187,11 @@ #define CONFIG_CMD_I2C_SPEED #endif +#undef CONFIG_HOSTCMD_I2C_CONTROL +#ifdef CONFIG_PLATFORM_EC_HOSTCMD_I2C_CONTROL +#define CONFIG_HOSTCMD_I2C_CONTROL +#endif + #undef CONFIG_BATTERY_PRESENT_CUSTOM #ifdef CONFIG_PLATFORM_EC_BATTERY_PRESENT_CUSTOM #define CONFIG_BATTERY_PRESENT_CUSTOM |