summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMurat Khairulin <kmy@silab.su>2015-05-05 19:43:19 +0300
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-05-12 09:35:17 +0200
commit6067e90bd06d55edbd3b1417369dda53ca11c0f0 (patch)
treeb52fc7232deb5e2b3a356b6d26875c4a96079077 /drivers
parentf1209c0da26fc54d8c567a039d7765b6ad23bd5b (diff)
spi:tegra: fix number of words in transfer
Calculate the number of words in a transfer properly: if there are 129-131 bytes, then number of words is more than 32, therefore the transfer should be handled with DMA rather than FIFO.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-tegra.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c
index 5fca5e62706c..2fd2fd68edfe 100644
--- a/drivers/spi/spi-tegra.c
+++ b/drivers/spi/spi-tegra.c
@@ -381,7 +381,7 @@ static unsigned spi_tegra_calculate_curr_xfer_param(
if (tspi->is_packed) {
max_len = min(remain_len, tspi->max_buf_size);
tspi->curr_dma_words = max_len/tspi->bytes_per_word;
- total_fifo_words = max_len/4;
+ total_fifo_words = (max_len + 3)/4;
} else {
max_word = (remain_len - 1) / tspi->bytes_per_word + 1;
max_word = min(max_word, tspi->max_buf_size/4);