dma: Modify qcom-sps-dma based on framework changes

Modify the qcom-sps-dma driver to adapt to the framework changes in
dmaengine introduced between kernel-3.18 and kernel-4.4 .

Change-Id: I000e209af6cf26e652d6937af67eb3382d2d2262
This commit is contained in:
Girish Mahadevan 2016-01-27 17:44:27 -07:00 committed by David Keitel
parent b286eb6096
commit debaf5e67f

View file

@ -394,10 +394,11 @@ need_disconnect:
*
* @cfg only cares about cfg->direction
*/
static int qbam_slave_cfg(struct qbam_channel *qbam_chan,
static int qbam_slave_cfg(struct dma_chan *chan,
struct dma_slave_config *cfg)
{
int ret = 0;
struct qbam_channel *qbam_chan = DMA_TO_QBAM_CHAN(chan);
struct qbam_device *qbam_dev = qbam_chan->qbam_dev;
struct sps_connect *pipe_cfg = &qbam_chan->bam_pipe.cfg;
@ -456,8 +457,9 @@ cfg_done:
return ret;
}
static int qbam_flush_chan(struct qbam_channel *qbam_chan)
static int qbam_flush_chan(struct dma_chan *chan)
{
struct qbam_channel *qbam_chan = DMA_TO_QBAM_CHAN(chan);
int ret = qbam_disconnect_chan(qbam_chan);
if (ret) {
qbam_err(qbam_chan->qbam_dev,
@ -473,35 +475,6 @@ static int qbam_flush_chan(struct qbam_channel *qbam_chan)
return ret;
}
/*
* qbam_control - DMA device control. entry point for channel configuration.
* @chan: dma channel
* @cmd: control cmd
* @arg: cmd argument
*/
static int qbam_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
unsigned long arg)
{
struct qbam_channel *qbam_chan = DMA_TO_QBAM_CHAN(chan);
int ret = 0;
switch (cmd) {
case DMA_SLAVE_CONFIG:
ret = qbam_slave_cfg(qbam_chan, (struct dma_slave_config *)arg);
break;
case DMA_TERMINATE_ALL:
ret = qbam_flush_chan(qbam_chan);
break;
default:
ret = -ENXIO;
qbam_err(qbam_chan->qbam_dev,
"error qbam_control(cmd:%d) unsupported\n", cmd);
break;
};
return ret;
}
/* qbam_tx_submit - sets the descriptor as the next one to be executed */
static dma_cookie_t qbam_tx_submit(struct dma_async_tx_descriptor *dma_desc)
{
@ -683,7 +656,8 @@ static int qbam_probe(struct platform_device *pdev)
qbam_dev->dma_dev.device_alloc_chan_resources = qbam_alloc_chan;
qbam_dev->dma_dev.device_free_chan_resources = qbam_free_chan;
qbam_dev->dma_dev.device_prep_slave_sg = qbam_prep_slave_sg;
qbam_dev->dma_dev.device_control = qbam_control;
qbam_dev->dma_dev.device_terminate_all = qbam_flush_chan;
qbam_dev->dma_dev.device_config = qbam_slave_cfg;
qbam_dev->dma_dev.device_issue_pending = qbam_issue_pending;
qbam_dev->dma_dev.device_tx_status = qbam_tx_status;