WIP FPC-III support
[linux/fpc-iii.git] / sound / soc / rockchip / rockchip_pcm.c
blob02254e42135e5390a312dc336f5922f3e8536bc3
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (c) 2018 Rockchip Electronics Co. Ltd.
4 */
6 #include <linux/device.h>
7 #include <linux/init.h>
8 #include <linux/module.h>
10 #include <sound/core.h>
11 #include <sound/pcm.h>
12 #include <sound/soc.h>
13 #include <sound/dmaengine_pcm.h>
15 #include "rockchip_pcm.h"
17 static const struct snd_pcm_hardware snd_rockchip_hardware = {
18 .info = SNDRV_PCM_INFO_MMAP |
19 SNDRV_PCM_INFO_MMAP_VALID |
20 SNDRV_PCM_INFO_PAUSE |
21 SNDRV_PCM_INFO_RESUME |
22 SNDRV_PCM_INFO_INTERLEAVED,
23 .period_bytes_min = 32,
24 .period_bytes_max = 8192,
25 .periods_min = 1,
26 .periods_max = 52,
27 .buffer_bytes_max = 64 * 1024,
28 .fifo_size = 32,
31 static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = {
32 .pcm_hardware = &snd_rockchip_hardware,
33 .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
34 .prealloc_buffer_size = 32 * 1024,
37 int rockchip_pcm_platform_register(struct device *dev)
39 return devm_snd_dmaengine_pcm_register(dev, &rk_dmaengine_pcm_config,
40 SND_DMAENGINE_PCM_FLAG_COMPAT);
42 EXPORT_SYMBOL_GPL(rockchip_pcm_platform_register);
44 MODULE_LICENSE("GPL v2");