Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: intel-mid-dma: Split device_control

Split the device_control callback of the Intel MID DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Maxime Ripard and committed by
Vinod Koul
71b5bd2a 7b350ab0

+6 -19
+6 -19
drivers/dma/intel_mid_dma.c
··· 492 492 return ret; 493 493 } 494 494 495 - static int dma_slave_control(struct dma_chan *chan, unsigned long arg) 495 + static int intel_mid_dma_config(struct dma_chan *chan, 496 + struct dma_slave_config *slave) 496 497 { 497 498 struct intel_mid_dma_chan *midc = to_intel_mid_dma_chan(chan); 498 - struct dma_slave_config *slave = (struct dma_slave_config *)arg; 499 499 struct intel_mid_dma_slave *mid_slave; 500 500 501 501 BUG_ON(!midc); ··· 509 509 midc->mid_slave = mid_slave; 510 510 return 0; 511 511 } 512 - /** 513 - * intel_mid_dma_device_control - DMA device control 514 - * @chan: chan for DMA control 515 - * @cmd: control cmd 516 - * @arg: cmd arg value 517 - * 518 - * Perform DMA control command 519 - */ 520 - static int intel_mid_dma_device_control(struct dma_chan *chan, 521 - enum dma_ctrl_cmd cmd, unsigned long arg) 512 + 513 + static int intel_mid_dma_terminate_all(struct dma_chan *chan) 522 514 { 523 515 struct intel_mid_dma_chan *midc = to_intel_mid_dma_chan(chan); 524 516 struct middma_device *mid = to_middma_device(chan->device); 525 517 struct intel_mid_dma_desc *desc, *_desc; 526 518 union intel_mid_dma_cfg_lo cfg_lo; 527 - 528 - if (cmd == DMA_SLAVE_CONFIG) 529 - return dma_slave_control(chan, arg); 530 - 531 - if (cmd != DMA_TERMINATE_ALL) 532 - return -ENXIO; 533 519 534 520 spin_lock_bh(&midc->lock); 535 521 if (midc->busy == false) { ··· 1134 1148 dma->common.device_prep_dma_memcpy = intel_mid_dma_prep_memcpy; 1135 1149 dma->common.device_issue_pending = intel_mid_dma_issue_pending; 1136 1150 dma->common.device_prep_slave_sg = intel_mid_dma_prep_slave_sg; 1137 - dma->common.device_control = intel_mid_dma_device_control; 1151 + dma->common.device_config = intel_mid_dma_config; 1152 + dma->common.device_terminate_all = intel_mid_dma_terminate_all; 1138 1153 1139 1154 /*enable dma cntrl*/ 1140 1155 iowrite32(REG_BIT0, dma->dma_base + DMA_CFG);