summaryrefslogtreecommitdiff
path: root/common/i2c_peripheral.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-11-24 13:59:13 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-30 16:52:14 +0000
commit171046ab529d027a10475c12a0b6dc1b0d053c33 (patch)
treed3569debfac29e21afb8d953924144d2bd282e20 /common/i2c_peripheral.c
parent529312de85aa8ec53dc3a4fcf1f6249b8195a1cb (diff)
downloadchrome-ec-171046ab529d027a10475c12a0b6dc1b0d053c33.tar.gz
COIL: Rename common i2c_peripheral file
Rename i2c_peripheral.c and update related build file. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibd72d3b20b0cc1c07d426fbcf4d76cfb2644bc54 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558904 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/i2c_peripheral.c')
-rw-r--r--common/i2c_peripheral.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/common/i2c_peripheral.c b/common/i2c_peripheral.c
new file mode 100644
index 0000000000..20a4b4b0ae
--- /dev/null
+++ b/common/i2c_peripheral.c
@@ -0,0 +1,28 @@
+/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* I2C peripheral cross-platform code for Chrome EC */
+
+#include "host_command.h"
+#include "i2c.h"
+#include "util.h"
+
+enum ec_status 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 = BIT(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));