linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.22-rc2-git] omap_uwire: SPI_CPHA mode bugfix
@ 2007-05-22 20:58 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2007-05-22 20:58 UTC (permalink / raw)
  To: Andrew Morton, Linux Kernel list
  Cc: Tony Lindgren,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	imre.deak-EmnPodGKVbzby3iVrkZq2A

From: Imre Deak <imre.deak-EmnPodGKVbzby3iVrkZq2A@public.gmane.org>

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-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

--- o26.orig/drivers/spi/omap_uwire.c	2007-05-22 07:49:52.000000000 -0700
+++ o26/drivers/spi/omap_uwire.c	2007-05-22 08:02:03.000000000 -0700
@@ -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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-22 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-22 20:58 [patch 2.6.22-rc2-git] omap_uwire: SPI_CPHA mode bugfix David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).