diff options
author | Simon Glass | 2021-01-16 14:52:22 -0700 |
---|---|---|
committer | Simon Glass | 2021-01-30 14:25:41 -0700 |
commit | d8e9a93895fb3ad710963ddef6a4cc7c43bd65f6 (patch) | |
tree | 1696ef961329c3eba9122bda0d0f7cb284165587 /include/cros_ec.h | |
parent | 3096ee866e7388277ad3968d9c7ea704589dedea (diff) |
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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h index f187bd0d4b5..f57e0cc4501 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 |