1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * linux/sound/arm/pxa2xx-pcm.c -- ALSA PCM interface for the Intel PXA2xx chip
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Author: Nicolas Pitre
6*4882a593Smuzhiyun * Created: Nov 30, 2004
7*4882a593Smuzhiyun * Copyright: (C) 2004 MontaVista Software, Inc.
8*4882a593Smuzhiyun */
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun #include <linux/dma-mapping.h>
11*4882a593Smuzhiyun #include <linux/module.h>
12*4882a593Smuzhiyun #include <linux/dmaengine.h>
13*4882a593Smuzhiyun #include <linux/of.h>
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #include <sound/core.h>
16*4882a593Smuzhiyun #include <sound/soc.h>
17*4882a593Smuzhiyun #include <sound/pxa2xx-lib.h>
18*4882a593Smuzhiyun #include <sound/dmaengine_pcm.h>
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun static const struct snd_soc_component_driver pxa2xx_soc_platform = {
21*4882a593Smuzhiyun .pcm_construct = pxa2xx_soc_pcm_new,
22*4882a593Smuzhiyun .pcm_destruct = pxa2xx_soc_pcm_free,
23*4882a593Smuzhiyun .open = pxa2xx_soc_pcm_open,
24*4882a593Smuzhiyun .close = pxa2xx_soc_pcm_close,
25*4882a593Smuzhiyun .hw_params = pxa2xx_soc_pcm_hw_params,
26*4882a593Smuzhiyun .hw_free = pxa2xx_soc_pcm_hw_free,
27*4882a593Smuzhiyun .prepare = pxa2xx_soc_pcm_prepare,
28*4882a593Smuzhiyun .trigger = pxa2xx_soc_pcm_trigger,
29*4882a593Smuzhiyun .pointer = pxa2xx_soc_pcm_pointer,
30*4882a593Smuzhiyun .mmap = pxa2xx_soc_pcm_mmap,
31*4882a593Smuzhiyun };
32*4882a593Smuzhiyun
pxa2xx_soc_platform_probe(struct platform_device * pdev)33*4882a593Smuzhiyun static int pxa2xx_soc_platform_probe(struct platform_device *pdev)
34*4882a593Smuzhiyun {
35*4882a593Smuzhiyun return devm_snd_soc_register_component(&pdev->dev, &pxa2xx_soc_platform,
36*4882a593Smuzhiyun NULL, 0);
37*4882a593Smuzhiyun }
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun static struct platform_driver pxa_pcm_driver = {
40*4882a593Smuzhiyun .driver = {
41*4882a593Smuzhiyun .name = "pxa-pcm-audio",
42*4882a593Smuzhiyun },
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun .probe = pxa2xx_soc_platform_probe,
45*4882a593Smuzhiyun };
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun module_platform_driver(pxa_pcm_driver);
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun MODULE_AUTHOR("Nicolas Pitre");
50*4882a593Smuzhiyun MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module");
51*4882a593Smuzhiyun MODULE_LICENSE("GPL");
52*4882a593Smuzhiyun MODULE_ALIAS("platform:pxa-pcm-audio");
53