summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2016-10-04 13:49:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-05 17:11:37 -0700
commit5f70312a264986f5853dfde457d39af47ba1c87d (patch)
tree1af1140c13af3b5a1eb120040d38c37c7d4246ad /chip
parentcab4ccf3f9217692ee092b92871876643b2351de (diff)
downloadchrome-ec-5f70312a264986f5853dfde457d39af47ba1c87d.tar.gz
i2c: Move I2C_MAX_HOST_PACKET_SIZE to i2c.h
This patch moves I2C_MAX_HOST_PACKET_SIZE to include/i2c.h. It's currently used only by i2c-stm32*.c but should be commonly available for other chips. It also moves i2c_get_protocol_info to common/i2c.c for the same reason. BUG=none BRANCH=none TEST=make runtest Change-Id: I28d8bca0167bb7b2ce99574601a6efb62fc20eca Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393328 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/stm32/i2c-stm32f0.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/chip/stm32/i2c-stm32f0.c b/chip/stm32/i2c-stm32f0.c
index 8710d73be5..d33941d5b5 100644
--- a/chip/stm32/i2c-stm32f0.c
+++ b/chip/stm32/i2c-stm32f0.c
@@ -27,12 +27,6 @@
/* Transmit timeout in microseconds */
#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
-/*
- * Max data size for a version 3 request/response packet. This is
- * big enough for EC_CMD_GET_VERSION plus header info.
- */
-#define I2C_MAX_HOST_PACKET_SIZE 128
-
#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR
#if (I2C_PORT_EC == STM32_I2C1_PORT)
#define IRQ_SLAVE STM32_IRQ_I2C1
@@ -612,26 +606,3 @@ static void i2c_init(void)
}
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
-#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR
-/**
- * Get protocol information
- */
-static 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
-