| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 4 | | - * published by the Free Software Foundation. |
|---|
| 5 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 6 | 2 | |
|---|
| 7 | 3 | #include <linux/slab.h> |
|---|
| 8 | 4 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 42 | 38 | struct dma_slave_config config; |
|---|
| 43 | 39 | int ret; |
|---|
| 44 | 40 | |
|---|
| 45 | | - dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
|---|
| 41 | + dma_params = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); |
|---|
| 46 | 42 | if (!dma_params) |
|---|
| 47 | 43 | return 0; |
|---|
| 48 | 44 | |
|---|
| .. | .. |
|---|
| 51 | 47 | return ret; |
|---|
| 52 | 48 | |
|---|
| 53 | 49 | snd_dmaengine_pcm_set_config_from_dai_data(substream, |
|---|
| 54 | | - snd_soc_dai_get_dma_data(rtd->cpu_dai, substream), |
|---|
| 50 | + snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream), |
|---|
| 55 | 51 | &config); |
|---|
| 56 | 52 | |
|---|
| 57 | 53 | ret = dmaengine_slave_config(chan, &config); |
|---|
| .. | .. |
|---|
| 99 | 95 | |
|---|
| 100 | 96 | runtime->hw = pxa2xx_pcm_hardware; |
|---|
| 101 | 97 | |
|---|
| 102 | | - dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
|---|
| 98 | + dma_params = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream); |
|---|
| 103 | 99 | if (!dma_params) |
|---|
| 104 | 100 | return 0; |
|---|
| 105 | 101 | |
|---|
| .. | .. |
|---|
| 124 | 120 | return ret; |
|---|
| 125 | 121 | |
|---|
| 126 | 122 | return snd_dmaengine_pcm_open( |
|---|
| 127 | | - substream, dma_request_slave_channel(rtd->cpu_dai->dev, |
|---|
| 123 | + substream, dma_request_slave_channel(asoc_rtd_to_cpu(rtd, 0)->dev, |
|---|
| 128 | 124 | dma_params->chan_name)); |
|---|
| 129 | 125 | } |
|---|
| 130 | 126 | EXPORT_SYMBOL(pxa2xx_pcm_open); |
|---|
| .. | .. |
|---|
| 179 | 175 | } |
|---|
| 180 | 176 | EXPORT_SYMBOL(pxa2xx_pcm_free_dma_buffers); |
|---|
| 181 | 177 | |
|---|
| 182 | | -int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd) |
|---|
| 178 | +void pxa2xx_soc_pcm_free(struct snd_soc_component *component, |
|---|
| 179 | + struct snd_pcm *pcm) |
|---|
| 180 | +{ |
|---|
| 181 | + pxa2xx_pcm_free_dma_buffers(pcm); |
|---|
| 182 | +} |
|---|
| 183 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_free); |
|---|
| 184 | + |
|---|
| 185 | +int pxa2xx_soc_pcm_new(struct snd_soc_component *component, |
|---|
| 186 | + struct snd_soc_pcm_runtime *rtd) |
|---|
| 183 | 187 | { |
|---|
| 184 | 188 | struct snd_card *card = rtd->card->snd_card; |
|---|
| 185 | 189 | struct snd_pcm *pcm = rtd->pcm; |
|---|
| .. | .. |
|---|
| 207 | 211 | } |
|---|
| 208 | 212 | EXPORT_SYMBOL(pxa2xx_soc_pcm_new); |
|---|
| 209 | 213 | |
|---|
| 210 | | -const struct snd_pcm_ops pxa2xx_pcm_ops = { |
|---|
| 211 | | - .open = pxa2xx_pcm_open, |
|---|
| 212 | | - .close = pxa2xx_pcm_close, |
|---|
| 213 | | - .ioctl = snd_pcm_lib_ioctl, |
|---|
| 214 | | - .hw_params = pxa2xx_pcm_hw_params, |
|---|
| 215 | | - .hw_free = pxa2xx_pcm_hw_free, |
|---|
| 216 | | - .prepare = pxa2xx_pcm_prepare, |
|---|
| 217 | | - .trigger = pxa2xx_pcm_trigger, |
|---|
| 218 | | - .pointer = pxa2xx_pcm_pointer, |
|---|
| 219 | | - .mmap = pxa2xx_pcm_mmap, |
|---|
| 220 | | -}; |
|---|
| 221 | | -EXPORT_SYMBOL(pxa2xx_pcm_ops); |
|---|
| 214 | +int pxa2xx_soc_pcm_open(struct snd_soc_component *component, |
|---|
| 215 | + struct snd_pcm_substream *substream) |
|---|
| 216 | +{ |
|---|
| 217 | + return pxa2xx_pcm_open(substream); |
|---|
| 218 | +} |
|---|
| 219 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_open); |
|---|
| 220 | + |
|---|
| 221 | +int pxa2xx_soc_pcm_close(struct snd_soc_component *component, |
|---|
| 222 | + struct snd_pcm_substream *substream) |
|---|
| 223 | +{ |
|---|
| 224 | + return pxa2xx_pcm_close(substream); |
|---|
| 225 | +} |
|---|
| 226 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_close); |
|---|
| 227 | + |
|---|
| 228 | +int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component, |
|---|
| 229 | + struct snd_pcm_substream *substream, |
|---|
| 230 | + struct snd_pcm_hw_params *params) |
|---|
| 231 | +{ |
|---|
| 232 | + return pxa2xx_pcm_hw_params(substream, params); |
|---|
| 233 | +} |
|---|
| 234 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_params); |
|---|
| 235 | + |
|---|
| 236 | +int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component, |
|---|
| 237 | + struct snd_pcm_substream *substream) |
|---|
| 238 | +{ |
|---|
| 239 | + return pxa2xx_pcm_hw_free(substream); |
|---|
| 240 | +} |
|---|
| 241 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_free); |
|---|
| 242 | + |
|---|
| 243 | +int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component, |
|---|
| 244 | + struct snd_pcm_substream *substream) |
|---|
| 245 | +{ |
|---|
| 246 | + return pxa2xx_pcm_prepare(substream); |
|---|
| 247 | +} |
|---|
| 248 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_prepare); |
|---|
| 249 | + |
|---|
| 250 | +int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component, |
|---|
| 251 | + struct snd_pcm_substream *substream, int cmd) |
|---|
| 252 | +{ |
|---|
| 253 | + return pxa2xx_pcm_trigger(substream, cmd); |
|---|
| 254 | +} |
|---|
| 255 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_trigger); |
|---|
| 256 | + |
|---|
| 257 | +snd_pcm_uframes_t |
|---|
| 258 | +pxa2xx_soc_pcm_pointer(struct snd_soc_component *component, |
|---|
| 259 | + struct snd_pcm_substream *substream) |
|---|
| 260 | +{ |
|---|
| 261 | + return pxa2xx_pcm_pointer(substream); |
|---|
| 262 | +} |
|---|
| 263 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_pointer); |
|---|
| 264 | + |
|---|
| 265 | +int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component, |
|---|
| 266 | + struct snd_pcm_substream *substream, |
|---|
| 267 | + struct vm_area_struct *vma) |
|---|
| 268 | +{ |
|---|
| 269 | + return pxa2xx_pcm_mmap(substream, vma); |
|---|
| 270 | +} |
|---|
| 271 | +EXPORT_SYMBOL(pxa2xx_soc_pcm_mmap); |
|---|
| 222 | 272 | |
|---|
| 223 | 273 | MODULE_AUTHOR("Nicolas Pitre"); |
|---|
| 224 | 274 | MODULE_DESCRIPTION("Intel PXA2xx sound library"); |
|---|