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>
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;
/*
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",
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");
} 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 */