|
@@ -49,11 +49,10 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
|
|
struct scatterlist *sg = host->sg_ptr, *sg_tmp;
|
|
struct scatterlist *sg = host->sg_ptr, *sg_tmp;
|
|
struct dma_async_tx_descriptor *desc = NULL;
|
|
struct dma_async_tx_descriptor *desc = NULL;
|
|
struct dma_chan *chan = host->chan_rx;
|
|
struct dma_chan *chan = host->chan_rx;
|
|
- struct tmio_mmc_data *pdata = host->pdata;
|
|
|
|
dma_cookie_t cookie;
|
|
dma_cookie_t cookie;
|
|
int ret, i;
|
|
int ret, i;
|
|
bool aligned = true, multiple = true;
|
|
bool aligned = true, multiple = true;
|
|
- unsigned int align = (1 << pdata->dma->alignment_shift) - 1;
|
|
|
|
|
|
+ unsigned int align = (1 << host->dma->alignment_shift) - 1;
|
|
|
|
|
|
for_each_sg(sg, sg_tmp, host->sg_len, i) {
|
|
for_each_sg(sg, sg_tmp, host->sg_len, i) {
|
|
if (sg_tmp->offset & align)
|
|
if (sg_tmp->offset & align)
|
|
@@ -126,11 +125,10 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
|
|
struct scatterlist *sg = host->sg_ptr, *sg_tmp;
|
|
struct scatterlist *sg = host->sg_ptr, *sg_tmp;
|
|
struct dma_async_tx_descriptor *desc = NULL;
|
|
struct dma_async_tx_descriptor *desc = NULL;
|
|
struct dma_chan *chan = host->chan_tx;
|
|
struct dma_chan *chan = host->chan_tx;
|
|
- struct tmio_mmc_data *pdata = host->pdata;
|
|
|
|
dma_cookie_t cookie;
|
|
dma_cookie_t cookie;
|
|
int ret, i;
|
|
int ret, i;
|
|
bool aligned = true, multiple = true;
|
|
bool aligned = true, multiple = true;
|
|
- unsigned int align = (1 << pdata->dma->alignment_shift) - 1;
|
|
|
|
|
|
+ unsigned int align = (1 << host->dma->alignment_shift) - 1;
|
|
|
|
|
|
for_each_sg(sg, sg_tmp, host->sg_len, i) {
|
|
for_each_sg(sg, sg_tmp, host->sg_len, i) {
|
|
if (sg_tmp->offset & align)
|
|
if (sg_tmp->offset & align)
|
|
@@ -262,8 +260,8 @@ out:
|
|
void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata)
|
|
void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata)
|
|
{
|
|
{
|
|
/* We can only either use DMA for both Tx and Rx or not use it at all */
|
|
/* We can only either use DMA for both Tx and Rx or not use it at all */
|
|
- if (!pdata->dma || (!host->pdev->dev.of_node &&
|
|
|
|
- (!pdata->dma->chan_priv_tx || !pdata->dma->chan_priv_rx)))
|
|
|
|
|
|
+ if (!host->dma || (!host->pdev->dev.of_node &&
|
|
|
|
+ (!host->dma->chan_priv_tx || !host->dma->chan_priv_rx)))
|
|
return;
|
|
return;
|
|
|
|
|
|
if (!host->chan_tx && !host->chan_rx) {
|
|
if (!host->chan_tx && !host->chan_rx) {
|
|
@@ -280,7 +278,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
|
dma_cap_set(DMA_SLAVE, mask);
|
|
dma_cap_set(DMA_SLAVE, mask);
|
|
|
|
|
|
host->chan_tx = dma_request_slave_channel_compat(mask,
|
|
host->chan_tx = dma_request_slave_channel_compat(mask,
|
|
- pdata->dma->filter, pdata->dma->chan_priv_tx,
|
|
|
|
|
|
+ host->dma->filter, host->dma->chan_priv_tx,
|
|
&host->pdev->dev, "tx");
|
|
&host->pdev->dev, "tx");
|
|
dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
|
|
dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
|
|
host->chan_tx);
|
|
host->chan_tx);
|
|
@@ -288,8 +286,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
|
if (!host->chan_tx)
|
|
if (!host->chan_tx)
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (pdata->dma->chan_priv_tx)
|
|
|
|
- cfg.slave_id = pdata->dma->slave_id_tx;
|
|
|
|
|
|
+ if (host->dma->chan_priv_tx)
|
|
|
|
+ cfg.slave_id = host->dma->slave_id_tx;
|
|
cfg.direction = DMA_MEM_TO_DEV;
|
|
cfg.direction = DMA_MEM_TO_DEV;
|
|
cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift);
|
|
cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift);
|
|
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
|
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
|
@@ -299,7 +297,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
|
goto ecfgtx;
|
|
goto ecfgtx;
|
|
|
|
|
|
host->chan_rx = dma_request_slave_channel_compat(mask,
|
|
host->chan_rx = dma_request_slave_channel_compat(mask,
|
|
- pdata->dma->filter, pdata->dma->chan_priv_rx,
|
|
|
|
|
|
+ host->dma->filter, host->dma->chan_priv_rx,
|
|
&host->pdev->dev, "rx");
|
|
&host->pdev->dev, "rx");
|
|
dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
|
|
dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
|
|
host->chan_rx);
|
|
host->chan_rx);
|
|
@@ -307,10 +305,10 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
|
if (!host->chan_rx)
|
|
if (!host->chan_rx)
|
|
goto ereqrx;
|
|
goto ereqrx;
|
|
|
|
|
|
- if (pdata->dma->chan_priv_rx)
|
|
|
|
- cfg.slave_id = pdata->dma->slave_id_rx;
|
|
|
|
|
|
+ if (host->dma->chan_priv_rx)
|
|
|
|
+ cfg.slave_id = host->dma->slave_id_rx;
|
|
cfg.direction = DMA_DEV_TO_MEM;
|
|
cfg.direction = DMA_DEV_TO_MEM;
|
|
- cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
|
|
|
|
|
|
+ cfg.src_addr = cfg.dst_addr + host->dma->dma_rx_offset;
|
|
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
|
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
|
cfg.dst_addr = 0;
|
|
cfg.dst_addr = 0;
|
|
ret = dmaengine_slave_config(host->chan_rx, &cfg);
|
|
ret = dmaengine_slave_config(host->chan_rx, &cfg);
|