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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user