diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2024-06-30 23:54:10 +0300 |
|---|---|---|
| committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2024-07-01 16:22:19 +0300 |
| commit | 69a13742b7c64ed89894caf7091539e164b3e97c (patch) | |
| tree | d3f717ac3bc60341f4d362d4ef724368e27d81d4 /include/linux | |
| parent | c05cb5bdf413a2a5051701a397082380758e37ec (diff) | |
| download | linux-69a13742b7c64ed89894caf7091539e164b3e97c.tar.xz | |
platform/chrome: cros_ec_proto: Introduce cros_ec_get_cmd_versions()
Retrieving the supported versions of a command is a fairly common
operation. Provide a helper for it.
If the command is not supported at all the EC returns
-EINVAL/EC_RES_INVALID_PARAMS.
This error is translated into an empty version mask as that is easier to
handle for callers and they don't need to know about the error details.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240630-cros_ec-charge-control-v5-3-8f649d018c52@weissschuh.net
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/platform_data/cros_ec_proto.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h index 6e9225bdf903..b34ed0cc1f8d 100644 --- a/include/linux/platform_data/cros_ec_proto.h +++ b/include/linux/platform_data/cros_ec_proto.h @@ -263,6 +263,8 @@ int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command int cros_ec_cmd_readmem(struct cros_ec_device *ec_dev, u8 offset, u8 size, void *dest); +int cros_ec_get_cmd_versions(struct cros_ec_device *ec_dev, u16 cmd); + /** * cros_ec_get_time_ns() - Return time in ns. * |
