]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform/chrome: cros_ec_proto: Introduce cros_ec_get_cmd_versions()
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 30 Jun 2024 20:54:10 +0000 (22:54 +0200)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 1 Jul 2024 13:22:19 +0000 (21:22 +0800)
commit69a13742b7c64ed89894caf7091539e164b3e97c
treed3f717ac3bc60341f4d362d4ef724368e27d81d4
parentc05cb5bdf413a2a5051701a397082380758e37ec
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>
drivers/platform/chrome/cros_ec_proto.c
include/linux/platform_data/cros_ec_proto.h