]> git.baikalelectronics.ru Git - kernel.git/commit
mpc52xx_spi: fix clearing status register
authorLuotao Fu <l.fu@pengutronix.de>
Fri, 13 Nov 2009 09:41:15 +0000 (10:41 +0100)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 9 Dec 2009 01:48:13 +0000 (18:48 -0700)
commit8d35760dfa948f6736e98514a5efb8dfa535f031
treeaa78154db557b29d4c01e3fa8a3884641f798397
parent49654f92d5f195af54c12347a5b8b49209ebf0ca
mpc52xx_spi: fix clearing status register

Before reading status register to check MODF failure, we have to clear it
first since the MODF flag will be set after initializing the spi master,
if the hardware comes up with a low SS. The processor datasheet reads:
Mode Fault flag -- bit sets if SS input goes low while SPI is configured as a
master. Flag is cleared automatically by an SPI status register read (with MODF
set) followed by a SPI control register 1 write.
Hence simply rereading the register is not sufficient to clear the flag. We
redo the write also to make sure to clear the flag.

V2 Changes:
* change variable type from int to u8

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/mpc52xx_spi.c