summaryrefslogtreecommitdiff
path: root/include/cros_ec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-17 00:52:22 +0300
committerSimon Glass <sjg@chromium.org>2021-01-31 00:25:41 +0300
commitd8e9a93895fb3ad710963ddef6a4cc7c43bd65f6 (patch)
tree1696ef961329c3eba9122bda0d0f7cb284165587 /include/cros_ec.h
parent3096ee866e7388277ad3968d9c7ea704589dedea (diff)
downloadu-boot-d8e9a93895fb3ad710963ddef6a4cc7c43bd65f6.tar.xz
cros_ec: Add a function for the hello message
This is used several times in this file. Put it in a function to avoid code duplication. Also add a test for this function. There are no cros_ec tests at present, so it is time to update the code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cros_ec.h')
-rw-r--r--include/cros_ec.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h
index f187bd0d4b..f57e0cc450 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -497,4 +497,15 @@ int cros_ec_get_lid_shutdown_mask(struct udevice *dev);
*/
int cros_ec_set_lid_shutdown_mask(struct udevice *dev, int enable);
+/**
+ * cros_ec_hello() - Send a hello message
+ *
+ * Sends a message with a fixed input value and checks that the expected output
+ * value is received
+ *
+ * @dev: CROS-EC device
+ * @handshakep: If non-NULL, returns received handshake value on error
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_hello(struct udevice *dev, uint *handshakep);
#endif