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

ASoC: pxa: remove snd_pcm_ops

snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8yz90e9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
f8772e17 540e59c6

+135 -27
+24 -2
include/sound/pxa2xx-lib.h
··· 10 10 struct snd_pcm_hw_params; 11 11 struct snd_soc_pcm_runtime; 12 12 struct snd_pcm; 13 + struct snd_soc_component; 13 14 14 15 extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, 15 16 struct snd_pcm_hw_params *params); ··· 24 23 struct vm_area_struct *vma); 25 24 extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream); 26 25 extern void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm); 27 - extern int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd); 28 - extern const struct snd_pcm_ops pxa2xx_pcm_ops; 26 + extern void pxa2xx_soc_pcm_free(struct snd_soc_component *component, 27 + struct snd_pcm *pcm); 28 + extern int pxa2xx_soc_pcm_new(struct snd_soc_component *component, 29 + struct snd_soc_pcm_runtime *rtd); 30 + extern int pxa2xx_soc_pcm_open(struct snd_soc_component *component, 31 + struct snd_pcm_substream *substream); 32 + extern int pxa2xx_soc_pcm_close(struct snd_soc_component *component, 33 + struct snd_pcm_substream *substream); 34 + extern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component, 35 + struct snd_pcm_substream *substream, 36 + struct snd_pcm_hw_params *params); 37 + extern int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component, 38 + struct snd_pcm_substream *substream); 39 + extern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component, 40 + struct snd_pcm_substream *substream); 41 + extern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component, 42 + struct snd_pcm_substream *substream, int cmd); 43 + extern snd_pcm_uframes_t 44 + pxa2xx_soc_pcm_pointer(struct snd_soc_component *component, 45 + struct snd_pcm_substream *substream); 46 + extern int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component, 47 + struct snd_pcm_substream *substream, 48 + struct vm_area_struct *vma); 29 49 30 50 /* AC97 */ 31 51
+67 -13
sound/arm/pxa2xx-pcm-lib.c
··· 175 175 } 176 176 EXPORT_SYMBOL(pxa2xx_pcm_free_dma_buffers); 177 177 178 - 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) 179 187 { 180 188 struct snd_card *card = rtd->card->snd_card; 181 189 struct snd_pcm *pcm = rtd->pcm; ··· 211 203 } 212 204 EXPORT_SYMBOL(pxa2xx_soc_pcm_new); 213 205 214 - const struct snd_pcm_ops pxa2xx_pcm_ops = { 215 - .open = pxa2xx_pcm_open, 216 - .close = pxa2xx_pcm_close, 217 - .ioctl = snd_pcm_lib_ioctl, 218 - .hw_params = pxa2xx_pcm_hw_params, 219 - .hw_free = pxa2xx_pcm_hw_free, 220 - .prepare = pxa2xx_pcm_prepare, 221 - .trigger = pxa2xx_pcm_trigger, 222 - .pointer = pxa2xx_pcm_pointer, 223 - .mmap = pxa2xx_pcm_mmap, 224 - }; 225 - EXPORT_SYMBOL(pxa2xx_pcm_ops); 206 + int pxa2xx_soc_pcm_open(struct snd_soc_component *component, 207 + struct snd_pcm_substream *substream) 208 + { 209 + return pxa2xx_pcm_open(substream); 210 + } 211 + EXPORT_SYMBOL(pxa2xx_soc_pcm_open); 212 + 213 + int pxa2xx_soc_pcm_close(struct snd_soc_component *component, 214 + struct snd_pcm_substream *substream) 215 + { 216 + return pxa2xx_pcm_close(substream); 217 + } 218 + EXPORT_SYMBOL(pxa2xx_soc_pcm_close); 219 + 220 + int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component, 221 + struct snd_pcm_substream *substream, 222 + struct snd_pcm_hw_params *params) 223 + { 224 + return pxa2xx_pcm_hw_params(substream, params); 225 + } 226 + EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_params); 227 + 228 + int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component, 229 + struct snd_pcm_substream *substream) 230 + { 231 + return pxa2xx_pcm_hw_free(substream); 232 + } 233 + EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_free); 234 + 235 + int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component, 236 + struct snd_pcm_substream *substream) 237 + { 238 + return pxa2xx_pcm_prepare(substream); 239 + } 240 + EXPORT_SYMBOL(pxa2xx_soc_pcm_prepare); 241 + 242 + int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component, 243 + struct snd_pcm_substream *substream, int cmd) 244 + { 245 + return pxa2xx_pcm_trigger(substream, cmd); 246 + } 247 + EXPORT_SYMBOL(pxa2xx_soc_pcm_trigger); 248 + 249 + snd_pcm_uframes_t 250 + pxa2xx_soc_pcm_pointer(struct snd_soc_component *component, 251 + struct snd_pcm_substream *substream) 252 + { 253 + return pxa2xx_pcm_pointer(substream); 254 + } 255 + EXPORT_SYMBOL(pxa2xx_soc_pcm_pointer); 256 + 257 + int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component, 258 + struct snd_pcm_substream *substream, 259 + struct vm_area_struct *vma) 260 + { 261 + return pxa2xx_pcm_mmap(substream, vma); 262 + } 263 + EXPORT_SYMBOL(pxa2xx_soc_pcm_mmap); 226 264 227 265 MODULE_AUTHOR("Nicolas Pitre"); 228 266 MODULE_DESCRIPTION("Intel PXA2xx sound library");
+11 -3
sound/soc/pxa/pxa-ssp.c
··· 869 869 870 870 static const struct snd_soc_component_driver pxa_ssp_component = { 871 871 .name = "pxa-ssp", 872 - .ops = &pxa2xx_pcm_ops, 873 - .pcm_new = pxa2xx_soc_pcm_new, 874 - .pcm_free = pxa2xx_pcm_free_dma_buffers, 872 + .pcm_construct = pxa2xx_soc_pcm_new, 873 + .pcm_destruct = pxa2xx_soc_pcm_free, 874 + .open = pxa2xx_soc_pcm_open, 875 + .close = pxa2xx_soc_pcm_close, 876 + .ioctl = snd_soc_pcm_lib_ioctl, 877 + .hw_params = pxa2xx_soc_pcm_hw_params, 878 + .hw_free = pxa2xx_soc_pcm_hw_free, 879 + .prepare = pxa2xx_soc_pcm_prepare, 880 + .trigger = pxa2xx_soc_pcm_trigger, 881 + .pointer = pxa2xx_soc_pcm_pointer, 882 + .mmap = pxa2xx_soc_pcm_mmap, 875 883 }; 876 884 877 885 #ifdef CONFIG_OF
+11 -3
sound/soc/pxa/pxa2xx-ac97.c
··· 204 204 205 205 static const struct snd_soc_component_driver pxa_ac97_component = { 206 206 .name = "pxa-ac97", 207 - .ops = &pxa2xx_pcm_ops, 208 - .pcm_new = pxa2xx_soc_pcm_new, 209 - .pcm_free = pxa2xx_pcm_free_dma_buffers, 207 + .pcm_construct = pxa2xx_soc_pcm_new, 208 + .pcm_destruct = pxa2xx_soc_pcm_free, 209 + .open = pxa2xx_soc_pcm_open, 210 + .close = pxa2xx_soc_pcm_close, 211 + .ioctl = snd_soc_pcm_lib_ioctl, 212 + .hw_params = pxa2xx_soc_pcm_hw_params, 213 + .hw_free = pxa2xx_soc_pcm_hw_free, 214 + .prepare = pxa2xx_soc_pcm_prepare, 215 + .trigger = pxa2xx_soc_pcm_trigger, 216 + .pointer = pxa2xx_soc_pcm_pointer, 217 + .mmap = pxa2xx_soc_pcm_mmap, 210 218 }; 211 219 212 220 #ifdef CONFIG_OF
+11 -3
sound/soc/pxa/pxa2xx-i2s.c
··· 360 360 361 361 static const struct snd_soc_component_driver pxa_i2s_component = { 362 362 .name = "pxa-i2s", 363 - .ops = &pxa2xx_pcm_ops, 364 - .pcm_new = pxa2xx_soc_pcm_new, 365 - .pcm_free = pxa2xx_pcm_free_dma_buffers, 363 + .pcm_construct = pxa2xx_soc_pcm_new, 364 + .pcm_destruct = pxa2xx_soc_pcm_free, 365 + .open = pxa2xx_soc_pcm_open, 366 + .close = pxa2xx_soc_pcm_close, 367 + .ioctl = snd_soc_pcm_lib_ioctl, 368 + .hw_params = pxa2xx_soc_pcm_hw_params, 369 + .hw_free = pxa2xx_soc_pcm_hw_free, 370 + .prepare = pxa2xx_soc_pcm_prepare, 371 + .trigger = pxa2xx_soc_pcm_trigger, 372 + .pointer = pxa2xx_soc_pcm_pointer, 373 + .mmap = pxa2xx_soc_pcm_mmap, 366 374 }; 367 375 368 376 static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)
+11 -3
sound/soc/pxa/pxa2xx-pcm.c
··· 18 18 #include <sound/dmaengine_pcm.h> 19 19 20 20 static const struct snd_soc_component_driver pxa2xx_soc_platform = { 21 - .ops = &pxa2xx_pcm_ops, 22 - .pcm_new = pxa2xx_soc_pcm_new, 23 - .pcm_free = pxa2xx_pcm_free_dma_buffers, 21 + .pcm_construct = pxa2xx_soc_pcm_new, 22 + .pcm_destruct = pxa2xx_soc_pcm_free, 23 + .open = pxa2xx_soc_pcm_open, 24 + .close = pxa2xx_soc_pcm_close, 25 + .ioctl = snd_soc_pcm_lib_ioctl, 26 + .hw_params = pxa2xx_soc_pcm_hw_params, 27 + .hw_free = pxa2xx_soc_pcm_hw_free, 28 + .prepare = pxa2xx_soc_pcm_prepare, 29 + .trigger = pxa2xx_soc_pcm_trigger, 30 + .pointer = pxa2xx_soc_pcm_pointer, 31 + .mmap = pxa2xx_soc_pcm_mmap, 24 32 }; 25 33 26 34 static int pxa2xx_soc_platform_probe(struct platform_device *pdev)