diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2015-02-02 06:26:22 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-02-26 18:44:52 -0500 |
commit | 1b84f2a4cd4a6f517a313261f6f7c8caae5696c6 (patch) | |
tree | 8e7b0f5a1477c8792a83c7de0b03b8dc0ad737a1 /include/linux/mfd | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
mfd: cros_ec: Use fixed size arrays to transfer data with the EC
The struct cros_ec_command will be used as an ioctl() argument for the
API to control the ChromeOS EC from user-space. So the data structure
has to be 64-bit safe to make it compatible between 32 and 64 avoiding
the need for a compat ioctl interface. Since pointers are self-aligned
to different byte boundaries, use fixed size arrays instead of pointers
for transferring ingoing and outgoing data with the Embedded Controller.
Also, re-arrange struct members by decreasing alignment requirements to
reduce the needing padding size.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r-- | include/linux/mfd/cros_ec.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h index 0e166b92f5b4..71675b14b5ca 100644 --- a/include/linux/mfd/cros_ec.h +++ b/include/linux/mfd/cros_ec.h | |||
@@ -38,20 +38,20 @@ enum { | |||
38 | /* | 38 | /* |
39 | * @version: Command version number (often 0) | 39 | * @version: Command version number (often 0) |
40 | * @command: Command to send (EC_CMD_...) | 40 | * @command: Command to send (EC_CMD_...) |
41 | * @outdata: Outgoing data to EC | ||
42 | * @outsize: Outgoing length in bytes | 41 | * @outsize: Outgoing length in bytes |
43 | * @indata: Where to put the incoming data from EC | ||
44 | * @insize: Max number of bytes to accept from EC | 42 | * @insize: Max number of bytes to accept from EC |
45 | * @result: EC's response to the command (separate from communication failure) | 43 | * @result: EC's response to the command (separate from communication failure) |
44 | * @outdata: Outgoing data to EC | ||
45 | * @indata: Where to put the incoming data from EC | ||
46 | */ | 46 | */ |
47 | struct cros_ec_command { | 47 | struct cros_ec_command { |
48 | uint32_t version; | 48 | uint32_t version; |
49 | uint32_t command; | 49 | uint32_t command; |
50 | uint8_t *outdata; | ||
51 | uint32_t outsize; | 50 | uint32_t outsize; |
52 | uint8_t *indata; | ||
53 | uint32_t insize; | 51 | uint32_t insize; |
54 | uint32_t result; | 52 | uint32_t result; |
53 | uint8_t outdata[EC_PROTO2_MAX_PARAM_SIZE]; | ||
54 | uint8_t indata[EC_PROTO2_MAX_PARAM_SIZE]; | ||
55 | }; | 55 | }; |
56 | 56 | ||
57 | /** | 57 | /** |