In 2.6.37, kernel dmaengine core introduced new slave config interfaces, this patch will enable dw_spi driver's dma to work on Moorestown with latest DMA APIs. This has been basically verified on Moorestown boards.
Signed-off-by: Feng Tang <[email protected]> --- drivers/spi/dw_spi_mid.c | 33 ++++++++++++++++++++------------- 1 files changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/spi/dw_spi_mid.c b/drivers/spi/dw_spi_mid.c index e47a6af..3254237 100644 --- a/drivers/spi/dw_spi_mid.c +++ b/drivers/spi/dw_spi_mid.c @@ -110,9 +110,10 @@ static void dw_spi_dma_done(void *arg) static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) { + struct mid_dma *dw_dma = dws->dma_priv; struct dma_async_tx_descriptor *txdesc = NULL, *rxdesc = NULL; struct dma_chan *txchan, *rxchan; - struct dma_slave_config txconf, rxconf; + struct dma_slave_config *txconf, *rxconf; u16 dma_ctrl = 0; /* 1. setup DMA related registers */ @@ -131,16 +132,20 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) dws->dma_chan_done = 0; txchan = dws->txchan; rxchan = dws->rxchan; + txconf = &dw_dma->dmas_tx.dma_slave; + rxconf = &dw_dma->dmas_rx.dma_slave; /* 2. Prepare the TX dma transfer */ - txconf.direction = DMA_TO_DEVICE; - txconf.dst_addr = dws->dma_addr; - txconf.dst_maxburst = LNW_DMA_MSIZE_16; - txconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - txconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + txconf->direction = DMA_TO_DEVICE; + txconf->dst_addr = dws->dma_addr; + txconf->src_addr = dws->tx_dma; + txconf->dst_maxburst = LNW_DMA_MSIZE_16; + txconf->src_maxburst = LNW_DMA_MSIZE_16; + txconf->src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + txconf->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; txchan->device->device_control(txchan, DMA_SLAVE_CONFIG, - (unsigned long) &txconf); + (unsigned long) txconf); memset(&dws->tx_sgl, 0, sizeof(dws->tx_sgl)); dws->tx_sgl.dma_address = dws->tx_dma; @@ -155,14 +160,16 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) txdesc->callback_param = dws; /* 3. Prepare the RX dma transfer */ - rxconf.direction = DMA_FROM_DEVICE; - rxconf.src_addr = dws->dma_addr; - rxconf.src_maxburst = LNW_DMA_MSIZE_16; - rxconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + rxconf->direction = DMA_FROM_DEVICE; + rxconf->src_addr = dws->dma_addr; + rxconf->dst_addr = dws->rx_dma; + rxconf->src_maxburst = LNW_DMA_MSIZE_16; + rxconf->dst_maxburst = LNW_DMA_MSIZE_16; + rxconf->dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + rxconf->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; rxchan->device->device_control(rxchan, DMA_SLAVE_CONFIG, - (unsigned long) &rxconf); + (unsigned long) rxconf); memset(&dws->rx_sgl, 0, sizeof(dws->rx_sgl)); dws->rx_sgl.dma_address = dws->rx_dma; -- 1.7.0.4 _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
