spi: xilinx_spi: Perform software reset during slave setup
authorJason Wu <jason.wu@petalogix.com>
Fri, 23 Nov 2012 05:05:08 +0000 (15:05 +1000)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 4 Feb 2013 11:09:49 +0000 (12:09 +0100)
to make sure it is in the clear state.

Signed-off-by: Jason Wu <huanyu@xilinx.com>
drivers/spi/xilinx_spi.c
drivers/spi/xilinx_spi.h

index 52a4134f18b956963d8aa65c6a814f57bb9b585e..db01cc25f71ae37a9ba54c10c87b019becfa885e 100644 (file)
@@ -99,6 +99,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        debug("%s: bus:%i cs:%i base:%p mode:%x max_hz:%d\n", __func__,
                bus, cs, xilspi->regs, xilspi->mode, xilspi->freq);
 
+       writel(SPISSR_RESET_VALUE, &xilspi->regs->srr);
+
        return &xilspi->slave;
 }
 
index 32610d2a121ab3791e8d922c6121fe7e0f853f67..69d0b940582f760aa94ae4d064a5bd22e7d82142 100644 (file)
@@ -119,6 +119,9 @@ struct xilinx_spi_reg {
 #define SPIRFOR_OCYVAL_POS     0
 #define SPIRFOR_OCYVAL_MASK    (0xf << SPIRFOR_OCYVAL_POS)
 
+/* SPI Software Reset Register (ssr) */
+#define SPISSR_RESET_VALUE     0x0a
+
 struct xilinx_spi_slave {
        struct spi_slave slave;
        struct xilinx_spi_reg *regs;