linux-kernel-test/drivers/spi
Atsushi Nemoto f6febccd7f atmel_spi: fix clock polarity
The atmel_spi driver does not initialize clock polarity correctly (except for
at91rm9200 CS0 channel) in some case.

The atmel_spi driver uses gpio-controlled chipselect.  OTOH spi clock signal
is controlled by CSRn.CPOL bit, but this register controls clock signal
correctly only in 'real transfer' duration.  At the time of cs_activate()
call, CSRn.CPOL will be initialized correctly, but the controller do not know
which channel is to be used next, so clock signal will stay at the inactive
state of last transfer.  If clock polarity of new transfer and last transfer
was differ, new transfer will start with wrong clock signal state.

For example, if you started SPI MODE 2 or 3 transfer after SPI MODE 0 or 1
transfer, the clock signal state at the assertion of chipselect will be low.
Of course this will violates SPI transfer.

This patch is short term solution for this problem.  It makes all CSRn.CPOL
match for the transfer before activating chipselect.  For longer term, the
best fix might be to let NPCS0 stay selected permanently in MR and overwrite
CSR0 with to the new slave's settings before asserting CS.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23 17:12:14 -08:00
..
at25.c spi: at25 driver is for EEPROM not FLASH 2007-12-05 09:21:18 -08:00
atmel_spi.c atmel_spi: fix clock polarity 2008-02-23 17:12:14 -08:00
atmel_spi.h
au1550_spi.c SPI controller drivers: check for unsupported modes 2007-07-17 10:23:04 -07:00
Kconfig spi: omap2_mcspi handles omap3 too 2008-02-06 10:41:11 -08:00
Makefile spi: SuperH SPI using SCI 2008-02-06 10:41:11 -08:00
mpc52xx_psc_spi.c [POWERPC] mpc52xx_psc_spi device driver must not touch port_config and cdm 2008-01-26 15:32:19 -07:00
omap2_mcspi.c spi: omap2_mcspi handles omap3 too 2008-02-06 10:41:11 -08:00
omap_uwire.c SPI driver runtime footprint shrinkage 2007-10-16 09:43:09 -07:00
pxa2xx_spi.c spi: remove more dev->power.power_state usage 2008-02-06 10:41:11 -08:00
spi_bfin5xx.c spi_bfin: headers are not for changelogs 2008-02-06 10:41:11 -08:00
spi_bitbang.c spi_bitbang: always grab lock with irqs blocked 2008-01-08 16:10:35 -08:00
spi_butterfly.c
spi_imx.c spi: remove more dev->power.power_state usage 2008-02-06 10:41:11 -08:00
spi_lm70llp.c spi doesn't need class_device 2007-10-16 09:43:10 -07:00
spi_mpc83xx.c spi_mpc83xx: use brg-frequency for SPI in QE 2008-01-28 08:32:57 -06:00
spi_s3c24xx_gpio.c spi: s3c drivers shouldn't care about spi_board_info 2008-02-06 10:41:11 -08:00
spi_s3c24xx.c spi: s3c drivers shouldn't care about spi_board_info 2008-02-06 10:41:11 -08:00
spi_sh_sci.c spi: SuperH SPI using SCI 2008-02-06 10:41:11 -08:00
spi_txx9.c spi: fix error paths on txx9spi_probe 2007-11-14 18:45:39 -08:00
spi.c spi core: stop updating dev->power.power_state 2008-02-06 10:41:10 -08:00
spidev.c fix abuses of ptrdiff_t 2007-10-29 07:41:33 -07:00
tle62x0.c tle62x0 driver stops ignoring read errors 2007-11-14 18:45:42 -08:00
xilinx_spi.c SPI driver hotplug/coldplug fixes 2007-08-31 01:42:22 -07:00