Skip to content

Commit

Permalink
spi: mediatek: use correct mata->xfer_len when in fifo transfer
Browse files Browse the repository at this point in the history
when xfer_len is greater than 64 bytes and use fifo mode
to transfer, the actual length from the third time is mata->xfer_len
but not len in mtk_spi_interrupt().

Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Leilk Liu authored and Mark Brown committed Oct 31, 2018

Unverified

No user is associated with the committer email.
1 parent 3511ba7 commit a4d8f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-mt65xx.c
Original file line number Diff line number Diff line change
@@ -522,11 +522,11 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
mdata->xfer_len = min(MTK_SPI_MAX_FIFO_SIZE, len);
mtk_spi_setup_packet(master);

cnt = len / 4;
cnt = mdata->xfer_len / 4;
iowrite32_rep(mdata->base + SPI_TX_DATA_REG,
trans->tx_buf + mdata->num_xfered, cnt);

remainder = len % 4;
remainder = mdata->xfer_len % 4;
if (remainder > 0) {
reg_val = 0;
memcpy(&reg_val,

0 comments on commit a4d8f64

Please sign in to comment.