diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2012-03-08 16:11:18 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-21 09:50:22 -0400 |
commit | 16052827d98fbc13c31ebad560af4bd53e2b4dd5 (patch) | |
tree | aff4f3362a643d2d4621f21dd56996988c0e733c /sound | |
parent | ad1122e545b55013089e6cc18ac37b47b46f2a7d (diff) |
dmaengine/dma_slave: introduce inline wrappers
Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic()
interfaces to hide new parameter from current users of affected interfaces.
Convert current users to use new wrappers instead of direct calls.
Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269].
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/ep93xx/ep93xx-pcm.c | 3 | ||||
-rw-r--r-- | sound/soc/imx/imx-pcm-dma-mx2.c | 2 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-pcm.c | 2 | ||||
-rw-r--r-- | sound/soc/sh/siu_pcm.c | 4 | ||||
-rw-r--r-- | sound/soc/txx9/txx9aclc.c | 2 |
5 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index de8390449873..50593e50ad57 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c | |||
@@ -142,11 +142,10 @@ static int ep93xx_pcm_dma_submit(struct snd_pcm_substream *substream) | |||
142 | struct snd_pcm_runtime *runtime = substream->runtime; | 142 | struct snd_pcm_runtime *runtime = substream->runtime; |
143 | struct ep93xx_runtime_data *rtd = runtime->private_data; | 143 | struct ep93xx_runtime_data *rtd = runtime->private_data; |
144 | struct dma_chan *chan = rtd->dma_chan; | 144 | struct dma_chan *chan = rtd->dma_chan; |
145 | struct dma_device *dma_dev = chan->device; | ||
146 | struct dma_async_tx_descriptor *desc; | 145 | struct dma_async_tx_descriptor *desc; |
147 | 146 | ||
148 | rtd->pointer_bytes = 0; | 147 | rtd->pointer_bytes = 0; |
149 | desc = dma_dev->device_prep_dma_cyclic(chan, runtime->dma_addr, | 148 | desc = dmaengine_prep_dma_cyclic(chan, runtime->dma_addr, |
150 | rtd->period_bytes * rtd->periods, | 149 | rtd->period_bytes * rtd->periods, |
151 | rtd->period_bytes, | 150 | rtd->period_bytes, |
152 | rtd->dma_data.direction); | 151 | rtd->dma_data.direction); |
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 52b0dedbf996..af46b4e2b438 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c | |||
@@ -160,7 +160,7 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, | |||
160 | 160 | ||
161 | iprtd->buf = (unsigned int *)substream->dma_buffer.area; | 161 | iprtd->buf = (unsigned int *)substream->dma_buffer.area; |
162 | 162 | ||
163 | iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, | 163 | iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, |
164 | iprtd->period_bytes * iprtd->periods, | 164 | iprtd->period_bytes * iprtd->periods, |
165 | iprtd->period_bytes, | 165 | iprtd->period_bytes, |
166 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 166 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 105f42a394df..661b678d08a8 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c | |||
@@ -132,7 +132,7 @@ static int snd_mxs_pcm_hw_params(struct snd_pcm_substream *substream, | |||
132 | 132 | ||
133 | iprtd->buf = substream->dma_buffer.area; | 133 | iprtd->buf = substream->dma_buffer.area; |
134 | 134 | ||
135 | iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, | 135 | iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, |
136 | iprtd->period_bytes * iprtd->periods, | 136 | iprtd->period_bytes * iprtd->periods, |
137 | iprtd->period_bytes, | 137 | iprtd->period_bytes, |
138 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 138 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index 0193e595d415..5cfcc655e95f 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c | |||
@@ -130,7 +130,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info, | |||
130 | sg_dma_len(&sg) = size; | 130 | sg_dma_len(&sg) = size; |
131 | sg_dma_address(&sg) = buff; | 131 | sg_dma_address(&sg) = buff; |
132 | 132 | ||
133 | desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, | 133 | desc = dmaengine_prep_slave_sg(siu_stream->chan, |
134 | &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 134 | &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
135 | if (!desc) { | 135 | if (!desc) { |
136 | dev_err(dev, "Failed to allocate a dma descriptor\n"); | 136 | dev_err(dev, "Failed to allocate a dma descriptor\n"); |
@@ -180,7 +180,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info, | |||
180 | sg_dma_len(&sg) = size; | 180 | sg_dma_len(&sg) = size; |
181 | sg_dma_address(&sg) = buff; | 181 | sg_dma_address(&sg) = buff; |
182 | 182 | ||
183 | desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, | 183 | desc = dmaengine_prep_slave_sg(siu_stream->chan, |
184 | &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 184 | &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
185 | if (!desc) { | 185 | if (!desc) { |
186 | dev_err(dev, "Failed to allocate dma descriptor\n"); | 186 | dev_err(dev, "Failed to allocate dma descriptor\n"); |
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 21554611557c..b609d2c64c55 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c | |||
@@ -132,7 +132,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr) | |||
132 | sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), | 132 | sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), |
133 | dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); | 133 | dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); |
134 | sg_dma_address(&sg) = buf_dma_addr; | 134 | sg_dma_address(&sg) = buf_dma_addr; |
135 | desc = chan->device->device_prep_slave_sg(chan, &sg, 1, | 135 | desc = dmaengine_prep_slave_sg(chan, &sg, 1, |
136 | dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 136 | dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
137 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, | 137 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, |
138 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 138 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |