summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorSowjanya Komatineni <skomatineni@nvidia.com>2019-04-05 03:14:01 +0300
committerMark Brown <broonie@kernel.org>2019-04-05 06:22:38 +0300
commit76457eea24db3c7d51f623c08838bbffda6ac3ad (patch)
treed3e7cb2904eb8e149614b144c4e297d7da4f1b9d /drivers/spi
parentf0a0bc90c6e7060778911c2b55d085105809d6cf (diff)
downloadlinux-76457eea24db3c7d51f623c08838bbffda6ac3ad.tar.xz
spi: tegra114: use unpacked mode for below 4 bytes
Packed mode expects minimum transfer length of 4 bytes. This patch fixes this by using unpacked mode for transfers less than 4 bytes. Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-tegra114.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index c2ebf1ae632d..ea67ff3b5b2c 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -259,7 +259,8 @@ static unsigned tegra_spi_calculate_curr_xfer_param(
tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8);
- if (bits_per_word == 8 || bits_per_word == 16 || bits_per_word == 32) {
+ if ((bits_per_word == 8 || bits_per_word == 16 ||
+ bits_per_word == 32) && t->len > 3) {
tspi->is_packed = 1;
tspi->words_per_32bit = 32/bits_per_word;
} else {