Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

omap_uwire: SPI_CPHA mode bugfix

The omap_uwire controller driver handles SPI_CPHA incorrectly;
It should mean:

CPHA=0 ... sample at leading edge of clock
CPHA=1 ... sample at trailing edge of clock

This bug has been masked by inverse bugs in layered drivers;
and was uncovered by running some of them on non-OMAP hardware.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Imre Deak and committed by
Linus Torvalds
e5f1b194 81fc6323

+2 -2
+2 -2
drivers/spi/omap_uwire.c
··· 358 358 switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { 359 359 case SPI_MODE_0: 360 360 case SPI_MODE_3: 361 - flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE; 361 + flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE; 362 362 break; 363 363 case SPI_MODE_1: 364 364 case SPI_MODE_2: 365 - flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE; 365 + flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE; 366 366 break; 367 367 } 368 368