]>
Commit | Line | Data |
---|---|---|
75b31192 JX |
1 | /* |
2 | * Copyright (c) 2018 Rockchip Electronics Co. Ltd. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License version 2 as | |
6 | * published by the Free Software Foundation. | |
7 | */ | |
8 | ||
9 | #include <linux/device.h> | |
10 | #include <linux/init.h> | |
11 | #include <linux/module.h> | |
12 | ||
13 | #include <sound/core.h> | |
14 | #include <sound/pcm.h> | |
15 | #include <sound/soc.h> | |
16 | #include <sound/dmaengine_pcm.h> | |
17 | ||
18 | #include "rockchip_pcm.h" | |
19 | ||
20 | static const struct snd_pcm_hardware snd_rockchip_hardware = { | |
21 | .info = SNDRV_PCM_INFO_MMAP | | |
22 | SNDRV_PCM_INFO_MMAP_VALID | | |
23 | SNDRV_PCM_INFO_PAUSE | | |
24d66383 KS |
24 | SNDRV_PCM_INFO_RESUME | |
25 | SNDRV_PCM_INFO_INTERLEAVED, | |
75b31192 JX |
26 | .period_bytes_min = 32, |
27 | .period_bytes_max = 8192, | |
28 | .periods_min = 1, | |
29 | .periods_max = 52, | |
30 | .buffer_bytes_max = 64 * 1024, | |
31 | .fifo_size = 32, | |
32 | }; | |
33 | ||
34 | static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = { | |
35 | .pcm_hardware = &snd_rockchip_hardware, | |
16a8ee4c | 36 | .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, |
75b31192 JX |
37 | .prealloc_buffer_size = 32 * 1024, |
38 | }; | |
39 | ||
40 | int rockchip_pcm_platform_register(struct device *dev) | |
41 | { | |
42 | return devm_snd_dmaengine_pcm_register(dev, &rk_dmaengine_pcm_config, | |
43 | SND_DMAENGINE_PCM_FLAG_COMPAT); | |
44 | } | |
45 | EXPORT_SYMBOL_GPL(rockchip_pcm_platform_register); | |
46 | ||
47 | MODULE_LICENSE("GPL v2"); |