···727727728728 chan->dir = direction;729729 chan->dev_addr = addr;730730- /* FIXME: drivers should be ported over to use the filter731731- * function. Once that's done, the following two lines can732732- * be removed.733733- */734734- if (cfg->slave_id)735735- chan->drcmr = cfg->slave_id;736730737731 return 0;738732}
-7
drivers/dma/pxa_dma.c
···909909 *dcmd |= PXA_DCMD_BURST16;910910 else if (maxburst == 32)911911 *dcmd |= PXA_DCMD_BURST32;912912-913913- /* FIXME: drivers should be ported over to use the filter914914- * function. Once that's done, the following two lines can915915- * be removed.916916- */917917- if (chan->cfg.slave_id)918918- chan->drcmr = chan->cfg.slave_id;919912}920913921914static struct dma_async_tx_descriptor *
+49-7
drivers/dma/qcom/qcom_adm.c
···88#include <linux/device.h>99#include <linux/dmaengine.h>1010#include <linux/dma-mapping.h>1111+#include <linux/dma/qcom_adm.h>1112#include <linux/init.h>1213#include <linux/interrupt.h>1314#include <linux/io.h>···141140142141 struct adm_async_desc *curr_txd;143142 struct dma_slave_config slave;143143+ u32 crci;144144+ u32 mux;144145 struct list_head node;145146146147 int error;···382379 return ERR_PTR(-EINVAL);383380 }384381385385- crci = achan->slave.slave_id & 0xf;386386- if (!crci || achan->slave.slave_id > 0x1f) {382382+ crci = achan->crci & 0xf;383383+ if (!crci || achan->crci > 0x1f) {387384 dev_err(adev->dev, "invalid crci value\n");388385 return ERR_PTR(-EINVAL);389386 }···406403 if (!async_desc)407404 return ERR_PTR(-ENOMEM);408405409409- if (crci)410410- async_desc->mux = achan->slave.slave_id & ADM_CRCI_MUX_SEL ?411411- ADM_CRCI_CTL_MUX_SEL : 0;406406+ async_desc->mux = achan->mux ? ADM_CRCI_CTL_MUX_SEL : 0;412407 async_desc->crci = crci;413408 async_desc->blk_size = blk_size;414409 async_desc->dma_len = single_count * sizeof(struct adm_desc_hw_single) +···489488static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)490489{491490 struct adm_chan *achan = to_adm_chan(chan);491491+ struct qcom_adm_peripheral_config *config = cfg->peripheral_config;492492 unsigned long flag;493493494494 spin_lock_irqsave(&achan->vc.lock, flag);495495 memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));496496+ if (cfg->peripheral_size == sizeof(config))497497+ achan->crci = config->crci;496498 spin_unlock_irqrestore(&achan->vc.lock, flag);497499498500 return 0;···698694 achan->vc.desc_free = adm_dma_free_desc;699695}700696697697+/**698698+ * adm_dma_xlate699699+ * @dma_spec: pointer to DMA specifier as found in the device tree700700+ * @ofdma: pointer to DMA controller data701701+ *702702+ * This can use either 1-cell or 2-cell formats, the first cell703703+ * identifies the slave device, while the optional second cell704704+ * contains the crci value.705705+ *706706+ * Returns pointer to appropriate dma channel on success or NULL on error.707707+ */708708+static struct dma_chan *adm_dma_xlate(struct of_phandle_args *dma_spec,709709+ struct of_dma *ofdma)710710+{711711+ struct dma_device *dev = ofdma->of_dma_data;712712+ struct dma_chan *chan, *candidate = NULL;713713+ struct adm_chan *achan;714714+715715+ if (!dev || dma_spec->args_count > 2)716716+ return NULL;717717+718718+ list_for_each_entry(chan, &dev->channels, device_node)719719+ if (chan->chan_id == dma_spec->args[0]) {720720+ candidate = chan;721721+ break;722722+ }723723+724724+ if (!candidate)725725+ return NULL;726726+727727+ achan = to_adm_chan(candidate);728728+ if (dma_spec->args_count == 2)729729+ achan->crci = dma_spec->args[1];730730+ else731731+ achan->crci = 0;732732+733733+ return dma_get_slave_channel(candidate);734734+}735735+701736static int adm_dma_probe(struct platform_device *pdev)702737{703738 struct adm_device *adev;···881838 goto err_disable_clks;882839 }883840884884- ret = of_dma_controller_register(pdev->dev.of_node,885885- of_dma_xlate_by_chan_id,841841+ ret = of_dma_controller_register(pdev->dev.of_node, adm_dma_xlate,886842 &adev->common);887843 if (ret)888844 goto err_unregister_dma;
-8
drivers/dma/sh/shdma-base.c
···787787 return -EINVAL;788788789789 /*790790- * overriding the slave_id through dma_slave_config is deprecated,791791- * but possibly some out-of-tree drivers still do it.792792- */793793- if (WARN_ON_ONCE(config->slave_id &&794794- config->slave_id != schan->real_slave_id))795795- schan->real_slave_id = config->slave_id;796796-797797- /*798790 * We could lock this, but you shouldn't be configuring the799791 * channel, while using it...800792 */
···1212#include <linux/clk.h>1313#include <linux/debugfs.h>1414#include <linux/delay.h>1515+#include <linux/dma/xilinx_dpdma.h>1516#include <linux/dmaengine.h>1617#include <linux/dmapool.h>1718#include <linux/interrupt.h>···12741273 struct dma_slave_config *config)12751274{12761275 struct xilinx_dpdma_chan *chan = to_xilinx_chan(dchan);12761276+ struct xilinx_dpdma_peripheral_config *pconfig;12771277 unsigned long flags;1278127812791279 /*···12841282 * fixed both on the DPDMA side and on the DP controller side.12851283 */1286128412871287- spin_lock_irqsave(&chan->lock, flags);12881288-12891285 /*12901290- * Abuse the slave_id to indicate that the channel is part of a video12911291- * group.12861286+ * Use the peripheral_config to indicate that the channel is part12871287+ * of a video group. This requires matching use of the custom12881288+ * structure in each driver.12921289 */12931293- if (chan->id <= ZYNQMP_DPDMA_VIDEO2)12941294- chan->video_group = config->slave_id != 0;12901290+ pconfig = config->peripheral_config;12911291+ if (WARN_ON(pconfig && config->peripheral_size != sizeof(*pconfig)))12921292+ return -EINVAL;1295129312941294+ spin_lock_irqsave(&chan->lock, flags);12951295+ if (chan->id <= ZYNQMP_DPDMA_VIDEO2 && pconfig)12961296+ chan->video_group = pconfig->video_group;12961297 spin_unlock_irqrestore(&chan->lock, flags);1297129812981299 return 0;
+7-2
drivers/gpu/drm/xlnx/zynqmp_disp.c
···24242525#include <linux/clk.h>2626#include <linux/delay.h>2727+#include <linux/dma/xilinx_dpdma.h>2728#include <linux/dma-mapping.h>2829#include <linux/dmaengine.h>2930#include <linux/module.h>···10591058 zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt);1060105910611060 /*10621062- * Set slave_id for each DMA channel to indicate they're part of a10611061+ * Set pconfig for each DMA channel to indicate they're part of a10631062 * video group.10641063 */10651064 for (i = 0; i < info->num_planes; i++) {10661065 struct zynqmp_disp_layer_dma *dma = &layer->dmas[i];10661066+ struct xilinx_dpdma_peripheral_config pconfig = {10671067+ .video_group = true,10681068+ };10671069 struct dma_slave_config config = {10681070 .direction = DMA_MEM_TO_DEV,10691069- .slave_id = 1,10711071+ .peripheral_config = &pconfig,10721072+ .peripheral_size = sizeof(pconfig),10701073 };1071107410721075 dmaengine_slave_config(dma->chan, &config);
···419419 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill420420 * with 'true' if peripheral should be flow controller. Direction will be421421 * selected at Runtime.422422- * @slave_id: Slave requester id. Only valid for slave channels. The dma423423- * slave peripheral will have unique id as dma requester which need to be424424- * pass as slave config.425422 * @peripheral_config: peripheral configuration for programming peripheral426423 * for dmaengine transfer427424 * @peripheral_size: peripheral configuration buffer size···446449 u32 src_port_window_size;447450 u32 dst_port_window_size;448451 bool device_fc;449449- unsigned int slave_id;450452 void *peripheral_config;451453 size_t peripheral_size;452454};
-2
include/sound/dmaengine_pcm.h
···6060 * @maxburst: Maximum number of words(note: words, as in units of the6161 * src_addr_width member, not bytes) that can be send to or received from the6262 * DAI in one burst.6363- * @slave_id: Slave requester id for the DMA channel.6463 * @filter_data: Custom DMA channel filter data, this will usually be used when6564 * requesting the DMA channel.6665 * @chan_name: Custom channel name to use when requesting DMA channel.···7374 dma_addr_t addr;7475 enum dma_slave_buswidth addr_width;7576 u32 maxburst;7676- unsigned int slave_id;7777 void *filter_data;7878 const char *chan_name;7979 unsigned int fifo_size;
+2-3
sound/core/pcm_dmaengine.c
···9191 * @dma_data: DAI DMA data9292 * @slave_config: DMA slave configuration9393 *9494- * Initializes the {dst,src}_addr, {dst,src}_maxburst, {dst,src}_addr_width and9595- * slave_id fields of the DMA slave config from the same fields of the DAI DMA9494+ * Initializes the {dst,src}_addr, {dst,src}_maxburst, {dst,src}_addr_width9595+ * fields of the DMA slave config from the same fields of the DAI DMA9696 * data struct. The src and dst fields will be initialized depending on the9797 * direction of the substream. If the substream is a playback stream the dst9898 * fields will be initialized, if it is a capture stream the src fields will be···124124 slave_config->src_addr_width = dma_data->addr_width;125125 }126126127127- slave_config->slave_id = dma_data->slave_id;128127 slave_config->peripheral_config = dma_data->peripheral_config;129128 slave_config->peripheral_size = dma_data->peripheral_size;130129}