Skip to content

Commit

Permalink
spi: tegra114: use unpacked mode for below 4 bytes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sowjanya Komatineni authored and Mark Brown committed Apr 5, 2019
1 parent f0a0bc9 commit 76457ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi-tegra114.c
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 76457ee

Please sign in to comment.