diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-16 14:52:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-30 14:25:41 -0700 |
commit | 3a6c994f3896d66e617acdf9bb58ffc4def08b71 (patch) | |
tree | d8b222358a56ab098e8a66a3f09a5b2b0d0066ee /include/cros_ec.h | |
parent | 2b4b65339110e11b4a859fceeb1eec82b2ebb5f1 (diff) | |
download | u-boot-3a6c994f3896d66e617acdf9bb58ffc4def08b71.tar.gz |
cros_ec: Add support for switches
On x86 platforms the EC provides a way to read 'switches', which are
on/off values determined by the EC.
Add a new driver method for this and implement it for LPC.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cros_ec.h')
-rw-r--r-- | include/cros_ec.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h index 26e3f3ba0cb..cb91343e3d8 100644 --- a/include/cros_ec.h +++ b/include/cros_ec.h @@ -279,6 +279,16 @@ struct dm_cros_ec_ops { * @return number of bytes in response, or -ve on error */ int (*packet)(struct udevice *dev, int out_bytes, int in_bytes); + + /** + * get_switches() - Get value of EC switches + * + * This is currently supported on the LPC EC. + * + * @dev: Device to use + * @return current switches value, or -ENOSYS if not supported + */ + int (*get_switches)(struct udevice *dev); }; #define dm_cros_ec_get_ops(dev) \ @@ -577,4 +587,13 @@ int cros_ec_get_features(struct udevice *dev, u64 *featuresp); */ int cros_ec_check_feature(struct udevice *dev, uint feature); +/** + * cros_ec_get_switches() - Get switches value + * + * @dev: CROS-EC device + * @return switches value, or -ENOSYS if not supported, or other -ve value on + * other error + */ +int cros_ec_get_switches(struct udevice *dev); + #endif |