diff options
author | Michael Williamson <michael.williamson@criticallink.com> | 2011-02-08 07:59:55 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-02-28 17:53:29 -0500 |
commit | 2e3e2a5e4fef586ae9b1cfef42823c0aef1797f4 (patch) | |
tree | 9b6619631c0798feff53c9f0d907abe2cf3b6394 /drivers/spi/davinci_spi.c | |
parent | a42f18c96da2220eaad603a7586d43cdd12d9f9f (diff) |
davinci: spi: move event queue parameter to platform data
For DMA operation, the davinci spi driver needs an event queue number.
Currently, this number is passed as a IORESOURCE_DMA. This is not
correct, as the event queue is not a DMA channel. Pass the event queue
via the platform data structure instead.
On dm355 and dm365, move the eventq assignment for spi0 out of resources
array and into platform data.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/spi/davinci_spi.c')
-rw-r--r-- | drivers/spi/davinci_spi.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index 6beab99bf95b..166a879fd9e8 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c | |||
@@ -790,7 +790,6 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
790 | struct resource *r, *mem; | 790 | struct resource *r, *mem; |
791 | resource_size_t dma_rx_chan = SPI_NO_RESOURCE; | 791 | resource_size_t dma_rx_chan = SPI_NO_RESOURCE; |
792 | resource_size_t dma_tx_chan = SPI_NO_RESOURCE; | 792 | resource_size_t dma_tx_chan = SPI_NO_RESOURCE; |
793 | resource_size_t dma_eventq = SPI_NO_RESOURCE; | ||
794 | int i = 0, ret = 0; | 793 | int i = 0, ret = 0; |
795 | u32 spipc0; | 794 | u32 spipc0; |
796 | 795 | ||
@@ -878,17 +877,13 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
878 | r = platform_get_resource(pdev, IORESOURCE_DMA, 1); | 877 | r = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
879 | if (r) | 878 | if (r) |
880 | dma_tx_chan = r->start; | 879 | dma_tx_chan = r->start; |
881 | r = platform_get_resource(pdev, IORESOURCE_DMA, 2); | ||
882 | if (r) | ||
883 | dma_eventq = r->start; | ||
884 | 880 | ||
885 | dspi->bitbang.txrx_bufs = davinci_spi_bufs; | 881 | dspi->bitbang.txrx_bufs = davinci_spi_bufs; |
886 | if (dma_rx_chan != SPI_NO_RESOURCE && | 882 | if (dma_rx_chan != SPI_NO_RESOURCE && |
887 | dma_tx_chan != SPI_NO_RESOURCE && | 883 | dma_tx_chan != SPI_NO_RESOURCE) { |
888 | dma_eventq != SPI_NO_RESOURCE) { | ||
889 | dspi->dma.rx_channel = dma_rx_chan; | 884 | dspi->dma.rx_channel = dma_rx_chan; |
890 | dspi->dma.tx_channel = dma_tx_chan; | 885 | dspi->dma.tx_channel = dma_tx_chan; |
891 | dspi->dma.eventq = dma_eventq; | 886 | dspi->dma.eventq = pdata->dma_event_q; |
892 | 887 | ||
893 | ret = davinci_spi_request_dma(dspi); | 888 | ret = davinci_spi_request_dma(dspi); |
894 | if (ret) | 889 | if (ret) |
@@ -897,7 +892,7 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
897 | dev_info(&pdev->dev, "DMA: supported\n"); | 892 | dev_info(&pdev->dev, "DMA: supported\n"); |
898 | dev_info(&pdev->dev, "DMA: RX channel: %d, TX channel: %d, " | 893 | dev_info(&pdev->dev, "DMA: RX channel: %d, TX channel: %d, " |
899 | "event queue: %d\n", dma_rx_chan, dma_tx_chan, | 894 | "event queue: %d\n", dma_rx_chan, dma_tx_chan, |
900 | dma_eventq); | 895 | pdata->dma_event_q); |
901 | } | 896 | } |
902 | 897 | ||
903 | dspi->get_rx = davinci_spi_rx_buf_u8; | 898 | dspi->get_rx = davinci_spi_rx_buf_u8; |