1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com
4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
7 #include <linux/module.h>
8 #include <sound/core.h>
10 #include <sound/pcm_params.h>
11 #include <sound/soc.h>
12 #include <sound/dmaengine_pcm.h>
16 static const struct snd_pcm_hardware udma_pcm_hardware
= {
17 .info
= SNDRV_PCM_INFO_MMAP
|
18 SNDRV_PCM_INFO_MMAP_VALID
|
19 SNDRV_PCM_INFO_PAUSE
| SNDRV_PCM_INFO_RESUME
|
20 SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
|
21 SNDRV_PCM_INFO_INTERLEAVED
,
22 .buffer_bytes_max
= SIZE_MAX
,
23 .period_bytes_min
= 32,
24 .period_bytes_max
= SZ_64K
,
26 .periods_max
= UINT_MAX
,
29 static const struct snd_dmaengine_pcm_config udma_dmaengine_pcm_config
= {
30 .pcm_hardware
= &udma_pcm_hardware
,
31 .prepare_slave_config
= snd_dmaengine_pcm_prepare_slave_config
,
34 int udma_pcm_platform_register(struct device
*dev
)
36 return devm_snd_dmaengine_pcm_register(dev
, &udma_dmaengine_pcm_config
,
39 EXPORT_SYMBOL_GPL(udma_pcm_platform_register
);
41 MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
42 MODULE_DESCRIPTION("UDMA PCM ASoC platform driver");
43 MODULE_LICENSE("GPL v2");