aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2012-02-01 05:42:27 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-02-22 07:45:39 -0500
commite2b35f3dbfc080f15b72834d08f04f0269dbe9be (patch)
treefda60f8be147b57cf01155528dda33a9a99b0dab /drivers
parent327e6970258618da810f72e86cf2a8b803927e14 (diff)
dmaengine/dw_dmac: Fix dw_dmac user drivers to adapt to slave_config changes
There are few existing user drivers of dw_dmac. They will break as soon as we remove unused fields from struct dw_dma_slave. This patch focuses to fix these user drivers to use dma_slave_config() routine. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/atmel-mci.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index fcfe1eb5acc8..3ba865ddebc4 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -24,6 +24,7 @@
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/stat.h> 26#include <linux/stat.h>
27#include <linux/types.h>
27 28
28#include <linux/mmc/host.h> 29#include <linux/mmc/host.h>
29#include <linux/mmc/sdio.h> 30#include <linux/mmc/sdio.h>
@@ -173,6 +174,7 @@ struct atmel_mci {
173 174
174 struct atmel_mci_dma dma; 175 struct atmel_mci_dma dma;
175 struct dma_chan *data_chan; 176 struct dma_chan *data_chan;
177 struct dma_slave_config dma_conf;
176 178
177 u32 cmd_status; 179 u32 cmd_status;
178 u32 data_status; 180 u32 data_status;
@@ -863,15 +865,16 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
863 865
864 if (data->flags & MMC_DATA_READ) { 866 if (data->flags & MMC_DATA_READ) {
865 direction = DMA_FROM_DEVICE; 867 direction = DMA_FROM_DEVICE;
866 slave_dirn = DMA_DEV_TO_MEM; 868 host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM;
867 } else { 869 } else {
868 direction = DMA_TO_DEVICE; 870 direction = DMA_TO_DEVICE;
869 slave_dirn = DMA_MEM_TO_DEV; 871 host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV;
870 } 872 }
871 873
872 sglen = dma_map_sg(chan->device->dev, data->sg, 874 sglen = dma_map_sg(chan->device->dev, data->sg,
873 data->sg_len, direction); 875 data->sg_len, direction);
874 876
877 dmaengine_slave_config(chan, &host->dma_conf);
875 desc = chan->device->device_prep_slave_sg(chan, 878 desc = chan->device->device_prep_slave_sg(chan,
876 data->sg, sglen, slave_dirn, 879 data->sg, sglen, slave_dirn,
877 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 880 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
@@ -1957,22 +1960,27 @@ static void atmci_configure_dma(struct atmel_mci *host)
1957 if (pdata && find_slave_dev(pdata->dma_slave)) { 1960 if (pdata && find_slave_dev(pdata->dma_slave)) {
1958 dma_cap_mask_t mask; 1961 dma_cap_mask_t mask;
1959 1962
1960 setup_dma_addr(pdata->dma_slave,
1961 host->mapbase + ATMCI_TDR,
1962 host->mapbase + ATMCI_RDR);
1963
1964 /* Try to grab a DMA channel */ 1963 /* Try to grab a DMA channel */
1965 dma_cap_zero(mask); 1964 dma_cap_zero(mask);
1966 dma_cap_set(DMA_SLAVE, mask); 1965 dma_cap_set(DMA_SLAVE, mask);
1967 host->dma.chan = 1966 host->dma.chan =
1968 dma_request_channel(mask, atmci_filter, pdata->dma_slave); 1967 dma_request_channel(mask, atmci_filter, pdata->dma_slave);
1969 } 1968 }
1970 if (!host->dma.chan) 1969 if (!host->dma.chan) {
1971 dev_notice(&host->pdev->dev, "DMA not available, using PIO\n"); 1970 dev_notice(&host->pdev->dev, "DMA not available, using PIO\n");
1972 else 1971 } else {
1973 dev_info(&host->pdev->dev, 1972 dev_info(&host->pdev->dev,
1974 "Using %s for DMA transfers\n", 1973 "Using %s for DMA transfers\n",
1975 dma_chan_name(host->dma.chan)); 1974 dma_chan_name(host->dma.chan));
1975
1976 host->dma_conf.src_addr = host->mapbase + ATMCI_RDR;
1977 host->dma_conf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1978 host->dma_conf.src_maxburst = 1;
1979 host->dma_conf.dst_addr = host->mapbase + ATMCI_TDR;
1980 host->dma_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1981 host->dma_conf.dst_maxburst = 1;
1982 host->dma_conf.device_fc = false;
1983 }
1976} 1984}
1977 1985
1978static inline unsigned int atmci_get_version(struct atmel_mci *host) 1986static inline unsigned int atmci_get_version(struct atmel_mci *host)