1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-26 16:13:55 +01:00

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>
This commit is contained in:
Simon Glass
2021-01-16 14:52:28 -07:00
parent 2b4b653391
commit 3a6c994f38
7 changed files with 120 additions and 0 deletions

View File

@@ -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