Skip to content

Commit

Permalink
spi/fsl-espi: Correct the maximum transaction length
Browse files Browse the repository at this point in the history
The maximum length during one transcation is 64KiB.

Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Hou Zhiqiang authored and Mark Brown committed Jan 22, 2016
1 parent cabeea9 commit 5cfa1e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-fsl-espi.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct fsl_espi_transfer {
/* SPCOM register values */
#define SPCOM_CS(x) ((x) << 30)
#define SPCOM_TRANLEN(x) ((x) << 0)
#define SPCOM_TRANLEN_MAX 0xFFFF /* Max transaction length */
#define SPCOM_TRANLEN_MAX 0x10000 /* Max transaction length */

#define AUTOSUSPEND_TIMEOUT 2000

Expand Down Expand Up @@ -233,7 +233,7 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
reinit_completion(&mpc8xxx_spi->done);

/* Set SPCOM[CS] and SPCOM[TRANLEN] field */
if ((t->len - 1) > SPCOM_TRANLEN_MAX) {
if (t->len > SPCOM_TRANLEN_MAX) {
dev_err(mpc8xxx_spi->dev, "Transaction length (%d)"
" beyond the SPCOM[TRANLEN] field\n", t->len);
return -EINVAL;
Expand Down

0 comments on commit 5cfa1e4

Please sign in to comment.