]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
spi: spi-ti-qspi: Fix FLEN and WLEN settings if bits_per_word is overridden
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Tue, 12 Apr 2016 11:56:25 +0000 (12:56 +0100)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commitf7732d9f1e61ef894295b4f5925d939784f8dc1f
treebce9fb2f59741b5161b34447dee21ee48fd26851
parenta8702fc5fc234a71e7f5798925bf0c90f4ed5bf6
spi: spi-ti-qspi: Fix FLEN and WLEN settings if bits_per_word is overridden

BugLink: http://bugs.launchpad.net/bugs/1584912
commit ea1b60fb085839a9544cb3a0069992991beabb7f upstream.

Each transfer can specify 8, 16 or 32 bits per word independently of
the default for the device being addressed.  However, currently we
calculate the number of words in the frame assuming that the word size
is the device default.

If multiple transfers in the same message have differing
bits_per_word, we bitwise-or the different values in the WLEN register
field.

Fix both of these.  Also rename 'frame_length' to 'frame_len_words' to
make clear that it's not a byte count like spi_message::frame_length.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/spi/spi-ti-qspi.c