diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2024-05-29 08:27:11 +0200 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2024-06-03 01:14:42 +0000 |
commit | a14a569a9918a0c7e340257a17dbc088bb27db72 (patch) | |
tree | 932f1901daaf478d5951c8b0a197be318e5c1eb5 /include/linux/platform_data | |
parent | 7b44d5381e541de3da3cee2e948456b250f41f25 (diff) | |
download | linux-a14a569a9918a0c7e340257a17dbc088bb27db72.tar.gz linux-a14a569a9918a0c7e340257a17dbc088bb27db72.tar.bz2 linux-a14a569a9918a0c7e340257a17dbc088bb27db72.zip |
platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_readmem()
To read from the EC memory different mechanism are possible.
ECs connected via LPC expose their memory via a ->cmd_readmem operation.
Other protocols require the usage of EC_CMD_READ_MEMMAP, which on the
other hand is not implemented by LPC ECs.
Provide a helper that automatically selects the correct mechanism.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240529-cros_ec-hwmon-v4-1-5cdf0c5db50a@weissschuh.net
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'include/linux/platform_data')
-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 8865e350c12a..1ddc52603f9a 100644 --- a/include/linux/platform_data/cros_ec_proto.h +++ b/include/linux/platform_data/cros_ec_proto.h @@ -261,6 +261,8 @@ int cros_ec_get_sensor_count(struct cros_ec_dev *ec); int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, const void *outdata, size_t outsize, void *indata, size_t insize); +int cros_ec_cmd_readmem(struct cros_ec_device *ec_dev, u8 offset, u8 size, void *dest); + /** * cros_ec_get_time_ns() - Return time in ns. * |