]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
fix SPI_CPHA related errors
authorDavid Brownell <dbrownell@users.sourceforge.net>
Fri, 25 May 2007 00:36:10 +0000 (17:36 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 25 May 2007 00:36:10 +0000 (17:36 -0700)
The OMAP SPI controller drivers handle SPI_CPHA incorrectly.
It should mean:

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

This fixes them, and the protocol drivers which depended on the wrong
meaning.  Separate ads7846 and omap_uwire patches are going upstream,
already since those drivers were already pushed there.  The tsc2102
code already had this right ... strange.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Kevin Hilman <khilman@mvista.com>
drivers/input/touchscreen/tsc2046_ts.c
drivers/spi/omap2_mcspi.c
drivers/spi/tsc2101.c
drivers/spi/tsc2301-core.c

index 4689fb6f3eebf839783cf3c4476daef650dd6dd8..80aea9fa59168f442a6850de83d8b9659edbc073 100644 (file)
@@ -499,7 +499,7 @@ static int __devinit tsc2046_probe(struct spi_device *spi)
        tsc->spi = spi;
        spi->dev.power.power_state = PMSG_ON;
 
-       spi->mode = SPI_MODE_1;
+       spi->mode = SPI_MODE_0;
        spi->bits_per_word = 16;
 
        /*
index 5f38556195b559f1dd93eb60246dd555c1e8f6ff..cc0885d3ea626ba9c678a7e81b6f3f98983b7204 100644 (file)
@@ -550,9 +550,9 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi,
        else
                l &= ~OMAP2_MCSPI_CHCONF_POL;
        if (spi->mode & SPI_CPHA)
-               l &= ~OMAP2_MCSPI_CHCONF_PHA;
-       else
                l |= OMAP2_MCSPI_CHCONF_PHA;
+       else
+               l &= ~OMAP2_MCSPI_CHCONF_PHA;
        mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, l);
 
        dev_dbg(&spi->dev, "setup: speed %d, sample %s edge, clk %s inverted\n",
index 258d856349ac9ee38f475328f44d13abe797d672..71702e2cb62bd9d1527afa1f155f98d0b631c176 100644 (file)
@@ -237,7 +237,7 @@ static int tsc2101_probe(struct spi_device *spi)
 
        mutex_init(&tsc2101->mutex);
 
-       spi->mode = SPI_MODE_0;
+       spi->mode = SPI_MODE_1;
        spi->bits_per_word = 16;
        if ((r = spi_setup(spi)) < 0) {
                dev_err(&spi->dev, "SPI setup failed\n");
index ae15ca93e65e50519dfb9b2b972ec5cf221358dc..500c3dcba6ad12cc46e3cf40987b57cae72c9e3a 100644 (file)
@@ -170,7 +170,7 @@ static int __devinit tsc2301_probe(struct spi_device *spi)
        } else
                tsc->reset_gpio = -1;
 
-       spi->mode = SPI_MODE_0;
+       spi->mode = SPI_MODE_1;
        spi->bits_per_word = 16;
        /* The max speed might've been defined by the board-specific
         * struct */