aboutsummaryrefslogtreecommitdiff
path: root/include/cros_ec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-16 14:52:26 -0700
committerSimon Glass <sjg@chromium.org>2021-01-30 14:25:41 -0700
commit8aec32f6abd722b141d96bc095999efa76bd0327 (patch)
tree127ce4a016602e527aded6c3ceb97c8121c34c78 /include/cros_ec.h
parent7791df576c4e0bcb0529850e14173d028ec37275 (diff)
downloadu-boot-8aec32f6abd722b141d96bc095999efa76bd0327.zip
u-boot-8aec32f6abd722b141d96bc095999efa76bd0327.tar.gz
u-boot-8aec32f6abd722b141d96bc095999efa76bd0327.tar.bz2
cros_ec: Support reading EC features
The EC can support a variety of features and provides a way to find out what is available. Add support for this. Also update the feature list to the lastest available while we are here. This is at: https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/include/ec_commands.h Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cros_ec.h')
-rw-r--r--include/cros_ec.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 1154cdc..338878c 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -516,4 +516,25 @@ int cros_ec_set_lid_shutdown_mask(struct udevice *dev, int enable);
* @return 0 if OK, -ve on error
*/
int cros_ec_hello(struct udevice *dev, uint *handshakep);
+
+/**
+ * cros_ec_get_features() - Get the set of features provided by the EC
+ *
+ * See enum ec_feature_code for the list of available features
+ *
+ * @dev: CROS-EC device
+ * @featuresp: Returns a bitmask of supported features
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_get_features(struct udevice *dev, u64 *featuresp);
+
+/**
+ * cros_ec_check_feature() - Check if a feature is supported
+ *
+ * @dev: CROS-EC device
+ * @feature: Feature number to check (enum ec_feature_code)
+ * @return true if supported, false if not, -ve on error
+ */
+int cros_ec_check_feature(struct udevice *dev, uint feature);
+
#endif