]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi/s3c64xx: Enable GPIO /CS prior to starting hardware
authorMark Brown <broonie@linaro.org>
Fri, 27 Sep 2013 19:38:01 +0000 (20:38 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 30 Sep 2013 11:53:39 +0000 (12:53 +0100)
To help with bisection of future refactoring to share more of the code for
handling a spi_message pull the enabling of GPIO based /CS prior to all
the hardware setup for starting a transfer.

Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-s3c64xx.c

index 2ab96fb28d222539d8bc908288bb9681af15c61f..e6312322f66a8997c1b5b0a7d765316291b3ab57 100644 (file)
@@ -906,6 +906,9 @@ static int s3c64xx_spi_transfer_one_message(struct spi_master *master,
                        s3c64xx_spi_config(sdd);
                }
 
+               /* Slave Select */
+               enable_cs(sdd, spi);
+
                /* Polling method for xfers not bigger than FIFO capacity */
                use_dma = 0;
                if (!is_polling(sdd) &&
@@ -921,9 +924,6 @@ static int s3c64xx_spi_transfer_one_message(struct spi_master *master,
 
                enable_datapath(sdd, spi, xfer, use_dma);
 
-               /* Slave Select */
-               enable_cs(sdd, spi);
-
                /* Start the signals */
                writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL);