spi: pxa2xx_spi clock polarity fix
authorNed Forrester <nforrester@whoi.edu>
Sat, 23 Feb 2008 23:23:40 +0000 (15:23 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 24 Feb 2008 01:12:14 +0000 (17:12 -0800)
commitb97c74bddce4e2c6fef6b3b58910b4fd9eb7f3b8
tree36e48f2687ba0c54350f740da796f321c7d2500c
parentf6febccd7f86fbe94858a4a32d9384cc014c9f40
spi: pxa2xx_spi clock polarity fix

Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select
for a transfer may be asserted before the clock polarity is set on the
interface.  As a result of this bug, the clock signal may have the wrong
polarity at transfer start, so it may need to make an extra half transition
before the intended clock/data signals begin.  (This probably means all
transfers are one bit out of sequence.)

This only occurs on the first transfer following a change in clock polarity
in systems using more than one more than one such polarity.  The fix
assures that the clock mode is properly set before asserting chip select.

This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20.
The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h
for 2.6.25 and newer kernels but this addition must be made in:
include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24,
inclusive

Signed-off-by: Ned Forrester <nforrester@whoi.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/pxa2xx_spi.c
include/asm-arm/arch-pxa/regs-ssp.h