aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/cros_ec.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-06-18 14:14:02 -0400
committerLee Jones <lee.jones@linaro.org>2014-07-09 09:58:17 -0400
commit5d4773e27e8ab37491767a6ef99ffd7100fe6341 (patch)
treef60c57790cbd87676c3dbe978565b925889b3543 /drivers/mfd/cros_ec.c
parent9c5edb6c458b04a243c4ba09a60349367b36e761 (diff)
mfd: cros_ec: Use struct cros_ec_command to communicate with the EC
This is some internal structure reorganization / renaming to prepare for future patches that will add a userspace API to cros_ec. There should be no visible changes. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec.c')
-rw-r--r--drivers/mfd/cros_ec.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index 04e053c71cc6..2e86c282f0b4 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -25,22 +25,22 @@
25#include <linux/mfd/cros_ec_commands.h> 25#include <linux/mfd/cros_ec_commands.h>
26 26
27int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 27int cros_ec_prepare_tx(struct cros_ec_device *ec_dev,
28 struct cros_ec_msg *msg) 28 struct cros_ec_command *msg)
29{ 29{
30 uint8_t *out; 30 uint8_t *out;
31 int csum, i; 31 int csum, i;
32 32
33 BUG_ON(msg->out_len > EC_PROTO2_MAX_PARAM_SIZE); 33 BUG_ON(msg->outsize > EC_PROTO2_MAX_PARAM_SIZE);
34 out = ec_dev->dout; 34 out = ec_dev->dout;
35 out[0] = EC_CMD_VERSION0 + msg->version; 35 out[0] = EC_CMD_VERSION0 + msg->version;
36 out[1] = msg->cmd; 36 out[1] = msg->command;
37 out[2] = msg->out_len; 37 out[2] = msg->outsize;
38 csum = out[0] + out[1] + out[2]; 38 csum = out[0] + out[1] + out[2];
39 for (i = 0; i < msg->out_len; i++) 39 for (i = 0; i < msg->outsize; i++)
40 csum += out[EC_MSG_TX_HEADER_BYTES + i] = msg->out_buf[i]; 40 csum += out[EC_MSG_TX_HEADER_BYTES + i] = msg->outdata[i];
41 out[EC_MSG_TX_HEADER_BYTES + msg->out_len] = (uint8_t)(csum & 0xff); 41 out[EC_MSG_TX_HEADER_BYTES + msg->outsize] = (uint8_t)(csum & 0xff);
42 42
43 return EC_MSG_TX_PROTO_BYTES + msg->out_len; 43 return EC_MSG_TX_PROTO_BYTES + msg->outsize;
44} 44}
45EXPORT_SYMBOL(cros_ec_prepare_tx); 45EXPORT_SYMBOL(cros_ec_prepare_tx);
46 46
@@ -48,14 +48,14 @@ static int cros_ec_command_sendrecv(struct cros_ec_device *ec_dev,
48 uint16_t cmd, void *out_buf, int out_len, 48 uint16_t cmd, void *out_buf, int out_len,
49 void *in_buf, int in_len) 49 void *in_buf, int in_len)
50{ 50{
51 struct cros_ec_msg msg; 51 struct cros_ec_command msg;
52 52
53 msg.version = cmd >> 8; 53 msg.version = cmd >> 8;
54 msg.cmd = cmd & 0xff; 54 msg.command = cmd & 0xff;
55 msg.out_buf = out_buf; 55 msg.outdata = out_buf;
56 msg.out_len = out_len; 56 msg.outsize = out_len;
57 msg.in_buf = in_buf; 57 msg.indata = in_buf;
58 msg.in_len = in_len; 58 msg.insize = in_len;
59 59
60 return ec_dev->cmd_xfer(ec_dev, &msg); 60 return ec_dev->cmd_xfer(ec_dev, &msg);
61} 61}