Skip to contentSkip to conversation

omap_uwire: SPI_CPHA mode bugfix

PATCH New David Brownell 1 participant 1 message May 22, 2007 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap_uwire: SPI_CPHA mode bugfix

From: Imre Deak <[email protected]>

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.

drivers/spi/omap_uwire.c +2 -2
@@ -358,11 +358,11 @@ static int uwire_setup_transfer(struct s
 	switch (spi->mode & (SPI_CPOL | SPI_CPHA)) {
 	case SPI_MODE_0:
 	case SPI_MODE_3:
-		flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE;
+		flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE;
 		break;
 	case SPI_MODE_1:
 	case SPI_MODE_2:
-		flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE;
+		flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE;
 		break;
 	}
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/