diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-07 10:16:37 -0600 |
---|---|---|
committer | Jagannadha Sutradharudu Teki <jaganna@xilinx.com> | 2014-08-06 00:18:01 +0530 |
commit | 2001b9a64165658e14f5afbe16874e0c55ddd04f (patch) | |
tree | 78ddefbf83b72b9abac99cf7196ba3d2c163e7ae /drivers/misc | |
parent | a52a178f0b4dce6a85a45ccea348be92fc7f1b6d (diff) | |
download | u-boot-imx-2001b9a64165658e14f5afbe16874e0c55ddd04f.zip u-boot-imx-2001b9a64165658e14f5afbe16874e0c55ddd04f.tar.gz u-boot-imx-2001b9a64165658e14f5afbe16874e0c55ddd04f.tar.bz2 |
cros_ec: Fix two bugs in the SPI implementation
An incorrect message version is passed to the EC in some cases and the
parameters of one function are switched.
Fix these problems.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cros_ec_spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/cros_ec_spi.c b/drivers/misc/cros_ec_spi.c index 7df709c..015333f 100644 --- a/drivers/misc/cros_ec_spi.c +++ b/drivers/misc/cros_ec_spi.c @@ -98,7 +98,7 @@ int cros_ec_spi_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version, } out = dev->dout; - out[0] = cmd_version; + out[0] = EC_CMD_VERSION0 + cmd_version; out[1] = cmd; out[2] = (uint8_t)dout_len; memcpy(out + 3, dout, dout_len); @@ -165,7 +165,7 @@ int cros_ec_spi_decode_fdt(struct cros_ec_dev *dev, const void *blob) */ int cros_ec_spi_init(struct cros_ec_dev *dev, const void *blob) { - dev->spi = spi_setup_slave_fdt(blob, dev->parent_node, dev->node); + dev->spi = spi_setup_slave_fdt(blob, dev->node, dev->parent_node); if (!dev->spi) { debug("%s: Could not setup SPI slave\n", __func__); return -1; |