Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * linux/sound/arm/pxa2xx-pcm.c -- ALSA PCM interface for the Intel PXA2xx chip
0004  *
0005  * Author:  Nicolas Pitre
0006  * Created: Nov 30, 2004
0007  * Copyright:   (C) 2004 MontaVista Software, Inc.
0008  */
0009 
0010 #include <linux/dma-mapping.h>
0011 #include <linux/module.h>
0012 #include <linux/dmaengine.h>
0013 #include <linux/of.h>
0014 
0015 #include <sound/core.h>
0016 #include <sound/soc.h>
0017 #include <sound/pxa2xx-lib.h>
0018 #include <sound/dmaengine_pcm.h>
0019 
0020 static const struct snd_soc_component_driver pxa2xx_soc_platform = {
0021     .pcm_construct  = pxa2xx_soc_pcm_new,
0022     .open       = pxa2xx_soc_pcm_open,
0023     .close      = pxa2xx_soc_pcm_close,
0024     .hw_params  = pxa2xx_soc_pcm_hw_params,
0025     .prepare    = pxa2xx_soc_pcm_prepare,
0026     .trigger    = pxa2xx_soc_pcm_trigger,
0027     .pointer    = pxa2xx_soc_pcm_pointer,
0028 };
0029 
0030 static int pxa2xx_soc_platform_probe(struct platform_device *pdev)
0031 {
0032     return devm_snd_soc_register_component(&pdev->dev, &pxa2xx_soc_platform,
0033                            NULL, 0);
0034 }
0035 
0036 static struct platform_driver pxa_pcm_driver = {
0037     .driver = {
0038         .name = "pxa-pcm-audio",
0039     },
0040 
0041     .probe = pxa2xx_soc_platform_probe,
0042 };
0043 
0044 module_platform_driver(pxa_pcm_driver);
0045 
0046 MODULE_AUTHOR("Nicolas Pitre");
0047 MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module");
0048 MODULE_LICENSE("GPL");
0049 MODULE_ALIAS("platform:pxa-pcm-audio");