diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-06-18 20:14:02 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-09 15:58:17 +0200 |
commit | 5d4773e27e8ab37491767a6ef99ffd7100fe6341 (patch) | |
tree | f60c57790cbd87676c3dbe978565b925889b3543 /drivers/mfd/cros_ec_spi.c | |
parent | mfd: cros_ec: Detect in-progress commands (diff) | |
download | linux-5d4773e27e8ab37491767a6ef99ffd7100fe6341.tar.xz linux-5d4773e27e8ab37491767a6ef99ffd7100fe6341.zip |
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_spi.c')
-rw-r--r-- | drivers/mfd/cros_ec_spi.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c index 9d45d88813b8..bef7735ecfde 100644 --- a/drivers/mfd/cros_ec_spi.c +++ b/drivers/mfd/cros_ec_spi.c @@ -216,7 +216,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev, * @ec_msg: Message to transfer */ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, - struct cros_ec_msg *ec_msg) + struct cros_ec_command *ec_msg) { struct cros_ec_spi *ec_spi = ec_dev->priv; struct spi_transfer trans; @@ -261,7 +261,7 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, /* Get the response */ if (!ret) { ret = cros_ec_spi_receive_response(ec_dev, - ec_msg->in_len + EC_MSG_TX_PROTO_BYTES); + ec_msg->insize + EC_MSG_TX_PROTO_BYTES); } else { dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret); } @@ -290,21 +290,21 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, if (ptr[0]) { if (ptr[0] == EC_RES_IN_PROGRESS) { dev_dbg(ec_dev->dev, "command 0x%02x in progress\n", - ec_msg->cmd); + ec_msg->command); ret = -EAGAIN; goto exit; } dev_warn(ec_dev->dev, "command 0x%02x returned an error %d\n", - ec_msg->cmd, ptr[0]); + ec_msg->command, ptr[0]); debug_packet(ec_dev->dev, "in_err", ptr, len); ret = -EINVAL; goto exit; } len = ptr[1]; sum = ptr[0] + ptr[1]; - if (len > ec_msg->in_len) { + if (len > ec_msg->insize) { dev_err(ec_dev->dev, "packet too long (%d bytes, expected %d)", - len, ec_msg->in_len); + len, ec_msg->insize); ret = -ENOSPC; goto exit; } @@ -312,8 +312,8 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, /* copy response packet payload and compute checksum */ for (i = 0; i < len; i++) { sum += ptr[i + 2]; - if (ec_msg->in_len) - ec_msg->in_buf[i] = ptr[i + 2]; + if (ec_msg->insize) + ec_msg->indata[i] = ptr[i + 2]; } sum &= 0xff; |