aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/davinci_spi.c
diff options
context:
space:
mode:
authorBrian Niebuhr <bniebuhr@efjohnson.com>2010-09-03 02:26:35 -0400
committerSekhar Nori <nsekhar@ti.com>2010-11-18 08:08:31 -0500
commitf34bd4cc68fb4548536cac56798d3fad41806724 (patch)
treed0f97088573823fc1af8a6e9d3d6a8b2520cd2e0 /drivers/spi/davinci_spi.c
parente0d205e9914476e96596c5339fa440fb314ef03b (diff)
spi: davinci: configure the invariable bits in spipc0 only once
Configure the data-in, data-out and clock functionality pins in SPIPC0 register only once during probe. No need to set these bits for each transfer. Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com> Tested-By: Michael Williamson <michael.williamson@criticallink.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/spi/davinci_spi.c')
-rw-r--r--drivers/spi/davinci_spi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 45cc1a77a51..6f279c5d8f9 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -536,9 +536,6 @@ static int davinci_spi_bufs_prep(struct spi_device *spi,
536 * optimize for both flags staying cleared. 536 * optimize for both flags staying cleared.
537 */ 537 */
538 538
539 op_mode = SPIPC0_DIFUN_MASK
540 | SPIPC0_DOFUN_MASK
541 | SPIPC0_CLKFUN_MASK;
542 if (!(spi->mode & SPI_NO_CS)) { 539 if (!(spi->mode & SPI_NO_CS)) {
543 pdata = davinci_spi->pdata; 540 pdata = davinci_spi->pdata;
544 if (!pdata->chip_sel || 541 if (!pdata->chip_sel ||
@@ -886,6 +883,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
886 resource_size_t dma_tx_chan = SPI_NO_RESOURCE; 883 resource_size_t dma_tx_chan = SPI_NO_RESOURCE;
887 resource_size_t dma_eventq = SPI_NO_RESOURCE; 884 resource_size_t dma_eventq = SPI_NO_RESOURCE;
888 int i = 0, ret = 0; 885 int i = 0, ret = 0;
886 u32 spipc0;
889 887
890 pdata = pdev->dev.platform_data; 888 pdata = pdev->dev.platform_data;
891 if (pdata == NULL) { 889 if (pdata == NULL) {
@@ -1028,6 +1026,10 @@ static int davinci_spi_probe(struct platform_device *pdev)
1028 udelay(100); 1026 udelay(100);
1029 iowrite32(1, davinci_spi->base + SPIGCR0); 1027 iowrite32(1, davinci_spi->base + SPIGCR0);
1030 1028
1029 /* Set up SPIPC0. CS and ENA init is done in davinci_spi_bufs_prep */
1030 spipc0 = SPIPC0_DIFUN_MASK | SPIPC0_DOFUN_MASK | SPIPC0_CLKFUN_MASK;
1031 iowrite32(spipc0, davinci_spi->base + SPIPC0);
1032
1031 /* initialize chip selects */ 1033 /* initialize chip selects */
1032 if (pdata->chip_sel) { 1034 if (pdata->chip_sel) {
1033 for (i = 0; i < pdata->num_chipselect; i++) { 1035 for (i = 0; i < pdata->num_chipselect; i++) {